Table Paging
This example shows how to turn on paging feature of DataTables
employeeNumber
|
firstName
|
lastName
|
jobTitle
|
extension
|
---|---|---|---|---|
1,002 | Diane | Murphy | President | x5800 |
1,056 | Mary | Patterson | VP Sales | x4611 |
1,076 | Jeff | Firrelli | VP Marketing | x9273 |
1,088 | William | Patterson | Sales Manager (APAC) | x4871 |
1,102 | Gerard | Bondur | Sale Manager (EMEA) | x5408 |
1,143 | Anthony | Bow | Sales Manager (NA) | x5428 |
1,165 | Leslie | Jennings | Sales Rep | x3291 |
1,166 | Leslie | Thompson | Sales Rep | x4065 |
1,188 | Julie | Firrelli | Sales Rep | x2173 |
1,216 | Steve | Patterson | Sales Rep | x4334 |
This example shows you how to set paging for DataTables.
DataTables::create(array(
...
"options"=>array(
"searching"=>true
)
));
<?php
require_once "MyReport.php";
$report = new MyReport;
$report->run()->render();
<?php
//Step 1: Load KoolReport
require_once "../../../load.koolreport.php";
//Step 2: Creating Report class
class MyReport extends \koolreport\KoolReport
{
function settings()
{
return array(
"dataSources"=>array(
"sakila_rental"=>array(
"connectionString"=>"mysql:host=localhost;dbname=automaker",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
),
)
);
}
protected function setup()
{
$this->src('automaker')
->query("SELECT employeeNumber, firstName,lastName,jobTitle, extension from employees")
->pipe($this->dataStore("employees"));
}
}
<?php
use \koolreport\datagrid\DataTables;
?>
<div class="report-content">
<div class="text-center">
<h1>Table Paging</h1>
<p class="lead">
This example shows how to turn on paging feature of DataTables
</p>
</div>
<?php
DataTables::create(array(
"dataSource"=>$this->dataStore("employees"),
"options"=>array(
"paging"=>true
)
));
?>
</div>
What People Are Saying
"KoolReport helps me very much in creating data report for my corporate! Keep up your good work!"
--
Alain Melsens
"The first use of your product. I was impressed by its easiness and powerfulness. This product is a great and amazing."
--
Dr. Lew Choy Onn
"Fantastic framework for reporting!"
--
Greg Schneider