KoolReport's Forum

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

No pagination while using datagrid with option paging=true #181

Open Naveen Aggarwal opened this topic on on Dec 28, 2017 - 4 comments

Naveen Aggarwal commented on Dec 28, 2017

Hi !

I am using the following code in view file to generate report using DataGrid. Not able to get pagination. Rather none of the options like search, sort working.

<?php 
    use \koolreport\datagrid\DataTables;
?>
<html>
    <head>
        <title>List of employees</title>
    </head>
    <body>
    <body>
        <h1>List of employees</h1>
        <?php
        DataTables::create(array(
            "dataStore"=>$this->dataStore("institutes")   getting error message here which goes after putting ,
            "options"=>array(
                "paging"=>true,
            )
        ));
        ?>
    </body>
</html>
KoolReport commented on Dec 29, 2017

Could you please tell me the error message.

Naveen Aggarwal commented on Dec 29, 2017

I am attaching the screenshot. This error goes away if I put a comma before options but I don't get desired output i.e. there is no paging/sorting etc. Error message displayed in browser reads as : Parse error: syntax error, unexpected '"options"' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in F:\apache24\htdocs\trialReport\institutes\trialReport.view.php on line 15

dimasmaliq commented on Dec 29, 2017

you should put a comma before options

KoolReport commented on Dec 29, 2017

Yes,definitely, here is a working example that I have tested:

<?php
DataTables::create(array(
    "dataStore"=>$this->dataStore("data"),
    "options"=>array(
        "paging"=>true,
        "searching"=>true,
    )
));
?>

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
help needed

DataGrid