Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by David Hutchings on Nov 04, 2008 11:18
open dhtmlx forum
Dynamic Loading, Pagination and Filtering/Sorting

We've set up the following grid, which uses JSON and dynamic loading:
[code]
    mygrid = new dhtmlXGridObject("gridbox");
    mygrid.setImagePath("../codebase/imgs/");
    mygrid.setHeader("DID,Author,To,CC,Subject,File Type");
    mygrid.attachHeader("#numeric_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter");
    mygrid.setInitWidths("100,110,130,130,300,70");
    mygrid.setColAlign("left,left,left,left,left,center");
    mygrid.setColTypes("ro,ro,ro,ro,ro,ro");
    mygrid.setColSorting("int,str,str,str,str,str");
    mygrid.enablePaging(true,100,null,"pagingArea",true);
    mygrid.init();
    mygrid.setPagingSkin("bricks");
    mygrid.load("../codebase/generateDocsJSON.jsp","json");
[/code]
The total_count value is set to 5000 records. Each request generates 1000 records.

When we attempt to enter a filter, we get a "'_locator' is null or not an object" error. I have confirmed that all rows being generated have a unique ID value.
When we attempt to sort a column, we get a "'this.rowsBuffer[...].idd' is null or not an object" error.

If the total_count is set to 1000 records or the request is set to generate 5000 records (in other words; if we don't use dynamic loading), then neither of these errors occur.
If we navigate enough to cause all 5 blocks of 1000 to load, then neither of these errors occur.

From the look of it, it seems like the dynamic loading aspect is preventing the filtering and sorting from being possible until such time as everything has been fully loaded into the grid. Is this supposed to be supported funcitonality? Or is this a known limitation?

Thanks!
Answer posted by Support on Nov 05, 2008 04:02
>>From the look of it, it seems like the dynamic loading aspect is preventing the filtering and sorting from being possible until such time as everything has been fully loaded into the grid.
This is known limitation. 
Both filtering and sorting requires all data to be available on client side to be executed ( it not possible to sort|filter not loaded rows ) 
If you are using dyn. loading you can implement server side filtering|sorting
 http://dhtmlx.com/docs/products/dhtmlxGrid/doc/step-by-step/ch_biggrid.html#grid_sbs_biggrid