Hi There,
I'm facing issue in getting pagination using server-side datatable. It shows me all the records at once either I applied all the options provided in documents. Here is the sample code :
<?php // MyReport.view.php
use \koolreport\datagrid\DataTables;
$get_heading = ["BIRTH_DATE","Document Text","testing"];
?>
<div class="report-content" style="padding:5%">
<div class='box-container'>
<?php
$columns = array();
$data_field = $this->dataStore('tablename')->data();
$i=0;
foreach($data_field[0] as $key=>$value)
{
$columns[$key] = array(
"label" => $get_heading[$i],
);
$i++;
}
DataTables::create(array(
'name' => 'DataTable1',
"dataSource"=>$this->dataStore("tablename"),
"columns"=>$columns,
"options" => array(
"searching" => true,
"paging" => true,
"colReorder" => true,
"order" => [],
"ordering" => false,
"pageLength" => 25
),
// "showFooter"=>true,
"serverSide"=>true,
"method"=>'post', //default method = 'get'
));
?>
</div>
</div>
The result I got all data at once on page.
Please let me know what I'm doing wrong? Thanks