KoolReport's Forum

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

Table paging with single page #352

Open Anita opened this topic on on Jul 5, 2018 - 3 comments

Anita commented on Jul 5, 2018

Dear support, I have been working on a single page. The paging works only partially - I can reduce number of rows displayed on one page to 10 (as written in the code) but I there's no page numbers displayed to click on (to go to another page). Here's the code:

<?php
require_once "../koolreport/autoload.php";
use \koolreport\widgets\koolphp\Table;

class Single_page extends \koolreport\KoolReport
{
    use \koolreport\instant\SinglePage;
    use \koolreport\clients\Bootstrap;

    function settings()
    {
        include "parametres_connexion_database.php";
        return  $database_connection;
    }

      function setup()
    {
        $this->src('myDatabase') ->query('SELECT * from main_request where "Team" = \'team\'')
    	
        ->pipe($this->dataStore("team1"));
        
    }
}
$report = new Single_page;
$report->start();
?>
<html>
    <head>
        <title>Table single page</title>
    </head>
    <body>
        <h1>Results</h1>
        <?php
            Table::create(array(
                "dataStore"=>$report->dataStore("team1"),
                 "columns"=>array("User id", "numberRequests"),
                  "paging"=>array(
                        "pageSize"=>10,
                        "align"=>"center",
                        "pageIndex"=>0,
                    )
            ));
        ?>
    </body>
</html>
<?php 
$report->end(); 
?>

Thanks in advance for your help

KoolReport commented on Jul 5, 2018

Hi Anita, Could you please let me know the location of "koolreport" folder. Is "koolreport" folder accessible by browser. Your code seems good but because the resource of table (js file) could not load that why's table paging is not working.

Anita commented on Jul 5, 2018

Hi Support, Here is the print screen:

It's working when I use the MVC architecture but not with a single page

KoolReport commented on Jul 7, 2018

I have told dev.team to investigate if something goes wrong. I will come back to you soon.

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