KoolReport's Forum

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

Pagination load error #1996

Open Oya Kaynar opened this topic on on Mar 26, 2021 - 1 comments

Oya Kaynar commented on Mar 26, 2021

DataTables::create(array(

            "dataSource"=>$this->dataStore($this->reportName),
            "serverSide"=>true,
            "method" => 'post',
            "columns" => array(...),

        "cssClass" => array(
            "table" => "table-bordered table-striped table-hover windesktable"
        ),

        "options" => array(
            "searching" => true,
            "paging" => true,
            "colReorder" => true,
            "order" => [],
            "pageLength" => 25,
            "fixedHeader" => true,
            "oLanguage" => array(
                "sLengthMenu"=> "_MENU_ kayıt göster",
                "sZeroRecords" => "Hiç kayıt yok",
                "sInfo" => "Toplamda <b>_TOTAL_</b> kayıttan <b>_START_</b> ve <b>_END_</b> arasındaki kayıtlar gösteriliyor.",
                "sInfoEmpty" => "",
                "sSearch" => "Filtrele/Ara",
                "oPaginate" => array("sPrevious" => "Önceki", "sNext" => "Sonraki")
            ),
        )
    ));

"serverSide" => true, when added it gives the attached error

Sebastian Morales commented on Mar 29, 2021

To make DataTables' serverSide work you would need to set its datasource as a function like this:

https://www.koolreport.com/examples/reports/datagrid/server_processing/

        'dataSource' => function() {
            return $this->src('employees')
            ->query('select * from employees_salaries'); //add more pipes and processes if you want
        },

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
None yet

None