I’m loading my grid with the following code:
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("…/…/dhtmlx/dhtmlxGrid/codebase/imgs/");
mygrid.setSkin(“dhx_skyblue”);
mygrid.enablePaging(true, 20, null, “pagingArea”, true, “recArea”);
mygrid.load("./siScanConfig",function(){
mygrid.load("./siScanData");
mygrid.xmlFileUrl = “./siScanData”;
});
The first .load() call retrieves XML that configures the grid and the columns, the second .load() call retrieves data to load into the rows. My question is, how do I get the 2nd request to pass along the posStart and count request parameters so I can properly return the correct rows from the server?
If you are using dynamic smart rendering mode grid will automatically pass posStart and count parameter to the request. Please check step-by-step tutorial here docs.dhtmlx.com/doku.php?id=dhtm … ep_by_step
I’ve enabled dynamic smart rendering on the grid and the parameters are now correctly passed, however, how do I prevent the grid from requesting more data from the server when a page is fully loaded? For example, this is what is happening: The grid loads the config XML, then loads the first 20 rows (which is what the page size is set to) but then continues to try and load more rows onto the page even though it already has 20 rows. How do I prevent this from happening?
but then continues to try and load more rows onto the page even though it already has 20 rows
Does Grid sends only 1 additional request or it continues sending many requests?
It is sending many requests. The difference between the link you provided and my code is that I have smart rendering enabled in my code while that sample does not, it only has paging enabled. You had told me that enabling smart rendering with paging would add the posStart and count request parameters to each request.
The difference between the link you provided and my code is that I have smart rendering enabled in my code while that sample does not, it only has paging enabled.
You should not use both enableSmartRendering() and enablePaging() methods in your grid. If you enable one of them grid will automatically send requests with posStart parameter to the server side.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan