Parameters posStart and count not sent to server

In my cases, mygrid.enableSmartRendering(true, 50);
If I use mygrid.loadXML(“data.php”), the server side could receive $_GET[“posStart”] and $_GET[“count”], according to the apache access log file.
However, if I use mygrid.loadXML(“data.php?xid=”+xid), the server side couldn’t get posStart and count, except for xid.

the client side codes look like below:
……
mygrid.init();
mygrid.enableSmartRendering(true, 50);
mygrid.loadXML(“data.php”,function(){}); // 1 or
mygrid.loadXML(“data.php”+“?xid=”+xid,function(){}); // 2, posStart and count NOT sent to server
……

the server side codes:
$grid->set_config($config);
$grid->event->attach(“beforeRender”, “my_beforeRend”);
$grid->dynamic_loading(30);
$grid->render_table(“temp”, “id”, “cntr,objname,mbrno,tag,realname,startyear,endyear,status,speciality,mbrtype”, “”);

Please beware that first call will not have posStart and count. Those parameters are included only in dyn. loading calls ( second loading call and next )

Also, be sure that you have not “#” character in the “xid” value, as it will break the url parsing

Stanislav, thank you for ur reply.
There’s no # character.
After $grid->dynamic_loading(30), the client can only get 30 records, although there’re thousands of records in DB. So I tried to find its cause in apache log file.

  1. dataview dynamic loading: could get posStart correctly, even if extra request is attached:
    127.0.0.1 - - [21/Feb/2014:08:16:57 +0800] “GET /pages/269/?cid=1&posStart=15&count=3 HTTP/1.1” 200 763
  2. grid dynamic loading with no extra request:correct (pls. see the attached)
  3. grid dynamic loading with an extra request:wrong (pls. see the attached)

Please try to enable logging

$grid->enable_log("log.txt");

and provide the log file for the problematic operation.

Stanislav,
pls. see below text.
I tried render_table and render sql, but it seems that LIMIT always 0,30 even if I scrolled the grid.



====================================
Log started, 19/04/2014 09:04:21
====================================

A session had already been started - ignoring session_start() at D:\website\data\web\kimgo_source\functions\dhtmlxConnector1.5\xss_filter.php line 178

SELECT DISTINCT `status` as value FROM `vw_school_objuser` WHERE ( `objid` = '56')

SELECT DISTINCT `speciality` as value FROM `vw_school_objuser` WHERE ( `objid` = '56')

SELECT DISTINCT `mbrtype` as value FROM `vw_school_objuser` WHERE ( `objid` = '56')

SELECT   ''  `cntr` ,CONCAT( `tag` , '_' , `mbrno` ) `id` , `tag` , `mbrno` , `mbrtype` , `objid` , `uid` , `startyear` , `endyear` , `status` , `speciality` , `objname` , `realname` FROM `vw_school_objuser` WHERE ( `objid` = '56') ORDER BY `mbrno` ASC LIMIT 0,30

SELECT COUNT(*) as DHX_COUNT  FROM `vw_school_objuser` WHERE ( `objid` = '56')

Done in 0.087008953094482s



====================================
Log started, 19/04/2014 09:04:23
====================================

A session had already been started - ignoring session_start() at D:\website\data\web\kimgo_source\functions\dhtmlxConnector1.5\xss_filter.php line 178

SELECT DISTINCT `status` as value FROM `vw_school_objuser` WHERE ( `objid` = '114')

SELECT DISTINCT `speciality` as value FROM `vw_school_objuser` WHERE ( `objid` = '114')

SELECT DISTINCT `mbrtype` as value FROM `vw_school_objuser` WHERE ( `objid` = '114')

SELECT   ''  `cntr` ,CONCAT( `tag` , '_' , `mbrno` ) `id` , `tag` , `mbrno` , `mbrtype` , `objid` , `uid` , `startyear` , `endyear` , `status` , `speciality` , `objname` , `realname` FROM `vw_school_objuser` WHERE ( `objid` = '114') ORDER BY `mbrno` ASC LIMIT 0,30

SELECT COUNT(*) as DHX_COUNT  FROM `vw_school_objuser` WHERE ( `objid` = '114')

Done in 0.20938682556152s



====================================
Log started, 19/04/2014 09:04:33
====================================

A session had already been started - ignoring session_start() at D:\website\data\web\kimgo_source\functions\dhtmlxConnector1.5\xss_filter.php line 178

SELECT DISTINCT `status` as value FROM `vw_school_objuser` WHERE ( `objid` = '112')

SELECT DISTINCT `speciality` as value FROM `vw_school_objuser` WHERE ( `objid` = '112')

SELECT DISTINCT `mbrtype` as value FROM `vw_school_objuser` WHERE ( `objid` = '112')

SELECT   ''  `cntr` ,CONCAT( `tag` , '_' , `mbrno` ) `id` , `tag` , `mbrno` , `mbrtype` , `objid` , `uid` , `startyear` , `endyear` , `status` , `speciality` , `objname` , `realname` FROM `vw_school_objuser` WHERE ( `objid` = '112') ORDER BY `mbrno` ASC LIMIT 0,30

SELECT COUNT(*) as DHX_COUNT  FROM `vw_school_objuser` WHERE ( `objid` = '112')

Done in 0.17020106315613s



====================================
Log started, 19/04/2014 09:04:45
====================================

A session had already been started - ignoring session_start() at D:\website\data\web\kimgo_source\functions\dhtmlxConnector1.5\xss_filter.php line 178

SELECT DISTINCT `status` as value FROM temp

SELECT DISTINCT `speciality` as value FROM temp

SELECT DISTINCT `mbrtype` as value FROM temp

SELECT `id`,`cntr`,`objname`,`mbrno`,`tag`,`realname`,`startyear`,`endyear`,`status`,`speciality`,`mbrtype` FROM temp LIMIT 0,30

SELECT COUNT(*) as DHX_COUNT  FROM temp

Done in 0.069891929626465s

Sorry, but I still can’t reconstruct the issue locally.
Exactly the same code works correctly for me :frowning:

Which version of dhtmlxgrid you are using ?
Can you provide a full sample or a link to the online demo ( you can send details by PM )

Stanislav, thank you so much.
I’m sure the problem lies in the front page (maybe the js files), not in grid.php or connector.php.
When I tried to reconstruct the issue, I simplified the front page (delete the toolbar, tree, etc., all other components), then it works very well, even if I use the origional grid.php.

I find the problem.
It turns out that the grid should be cleared before reloading on the client side.

 function navTree_event() {
    navTree.attachEvent("onSelect", function(objid) {
      userGrid_refresh(userGrid, objid);
    });
 }

function userGrid_refresh(grid, objid) {
  grid.clearAll(true); // fail if without this line
  grid.loadXML("<?= c_common::sf_id2path(866) ?>" + "?objid=" + objid);
}