Get KoolPHP UI with 30% OFF!

KoolGrid Paging doesn't work

Michael
Hello.
I am using KoolGrid with pager, but the pager buttons don't work.
Instead I am only seeing javascript: void 0 when I click a link or button.
What I am missing here?
<?php 
    /*
     * Please put this file in the same folder with KoolControls folder
     * or you may modify path of require and scriptFolder to refer correctly
     * to koolgrid.php and its folder.
     */
    require "KoolControls/KoolGrid/koolgrid.php";
 
    $db_con = mysql_connect("localhost","sakila","caroline");
    mysql_select_db("sakila",$db_con);
 
    $ds = new MySQLDataSource($db_con);
    $ds->SelectCommand = "select actor_id, first_name, last_name from actor";
    //$ds->UpdateCommand = "update tblUsers set name='@name' where id='@id'";
    //$ds->InsertCommand = "insert into tblUsers(id,name) values('@id','@name')";
    //$ds->DeleteCommand = "delete from tblUsers where id=@id";
 
    $grid = new KoolGrid("grid");
    $grid->scriptFolder = "KoolControls/KoolGrid";
    $grid->DataSource = $ds;
    
    
 
    $grid->styleFolder = "default";
    $grid->Width = "655px";
    $grid->AjaxEnabled = true;
    $grid->KeepRowStateOnRefresh = true;
    $grid->MasterTable->AllowHovering = true;
    $grid->MasterTable->AllowSelecting = true;
    $grid->MasterTable->AutoGenerateColumns = true;
    $grid->MasterTable->AutoGenerateDeleteColumn = false;
    $grid->MasterTable->AutoGenerateExpandColumn = false;
    $grid->MasterTable->Width = "655px";
    $grid->MasterTable->RowAlternative = true;
    $grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
 
 
    $grid->Process();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>KoolGrid</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    </head>
    <body>
        <?php echo $grid->Render(); ?>
    </body>
</html>

Best regards,
Michael
Posted Jul 1, 2016 , edited Jul 1, 2016 Kool
Igor
Hi,
u can try with this:
    
$grid->MasterTable->Pager = new GridPrevNextAndNumericPager();
$grid->MasterTable->Pager->PageSize = 50;
$grid->MasterTable->Pager->Position = "top";//Show both pager
Posted Jul 1, 2016 Kool
Michael
thanks for the tip, but this does not make the pager work, the table will display 50 instead of the 10 default rows.
Posted Jul 1, 2016 Kool
Michael
i found the solution: <?php echo $koolajax->Render();?> was missing.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>KoolGrid</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    </head>
    <body>
        <form id="form1" method="post"> <!-- You should render the grid inside a form tag, in case $grid->AjaxEnabled = false the grid needs a form to operate. -->
		<?php echo $koolajax->Render();?>
		<?php echo $grid->Render();?>
	</form>
    </body>
</html>
Posted Jul 1, 2016 , edited Jul 1, 2016 Kool -