KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DataGrid / Datatable - Button Options #2052

Closed Lloyd opened this topic on on May 3, 2021 - 2 comments

Lloyd commented on May 3, 2021

When I add the code

"dom" => 'Bfrtip', "buttons" => [

"copy", "csv", "excel", "pdf", "print", "colvis"

],

the Show selector to select the number of entries to show per page disappears.

Below is the my view code for a DataTable

DataTables::create(array(

     "name" => "hoursworked",
							                              
"dataSource" => $this->dataStore('data'),
															
"columns"=>array(
	'username' => array('label' => 'User Name',), 
	'project_id' => array('label' => 'Project Id',), 
	'activity_id' => array('label' => 'Activity Id',), 
	'task_id' => array('label' => 'Task Id',), 
	'deliverable_id' => array('label' => 'Deliverable Id',), 
	'working_date' => array('label' => 'Working Date',), 
				
	'hours' => array('label' => 'Hours', "footer" => "sum"), 
	'hours_overtime' => array('label' => 'Hours Overtime', "footer" => "sum"), 
	'bank_regular_hours' => array('label' => 'Bank Regular Hours', "footer" => "sum"), 
	'bank_overtime_hours' => array('label' => 'Bank Overtime Hours', "footer" => "sum"), 
				
	'validation' => array('label' => 'Validation',),
),
			
"clientRowGroup" => [
	"username" => [
		'direction' => 'asc', 
					
		'calculate' => [
			'hours' => ['sum', 'hours'],
			'hoursOvertime' => ['sum', 'hours_overtime'],
			'bankRegularHours' => ['sum', 'bank_regular_hours'],
			'bankOvertimeHours' => ['sum', 'bank_overtime_hours'],
		],
											
		"top" => "<td colspan='11' style = 'background-color: DodgerBlue'; style = 'color: black'>{username}</td>",
		"bottom" => "<td>{username}</td><td></td><td></td><td></td><td></td><td></td><td>{hours}</td>            
                                         <td>{hoursOvertime}</td><td>{bankRegularHours}</td><td>{bankOvertimeHours} 
                                         </td><td><div style='page-break-before:always;'></div></td>",
	],
],
			
"plugins" => ["Buttons", "FixedColumns", "FixedHeader", "KeyTable", "Responsive", "RowReorder", "Scroller", 
    "SearchPanes"],
														  
"options" => [
	"colReorder"=>true,
	"searching" => true,
	"paging" => true,
	"pageLength" => 25,
				
	"dom" => 'Bfrtip',
	"buttons" => [
		"copy", "csv", "excel", "pdf", "print", "colvis"
	],
],
			
//"themeBase"=>"bs4",
//"searchOnEnter" => true,
//"searchMode" => "or"

)); `

Is this a bug, or am I doing something wrong. Any help in getting this to work would be greatly appreiated.

Thank you

Lloyd

Sebastian Morales commented on May 4, 2021

Pls add the "l" letter to your "dom" property to show the page length menu (l in length):

    "dom" => 'Blfrtip',

Rgds,

Lloyd commented on May 4, 2021

That worked

Thank you

Lloyd

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

DataGrid