Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jonathan on Jun 27, 2008 08:27
open dhtmlx forum
Grid Paging

I've tried both of the suggestions you've had regarding using onBeforePageChanged events and the grid still does not function the way I need it to. Most of the time the grid places numerous calls to the server depending on whether I'm navigating forward or backward and a lot of the time the grid does not update from the new XML properly.

In paging mode how does the grid determine which rows or pages are cached and which aren't? Is there a way to fool the grid into thinking that the previously viewed rows or pages have not been loaded? If this isn't possible I have 2 choices. 1. Scrap the use of the grid altogether. 2. Write my own page navigation so I can force what is loaded and what isn't. Neither option is something I want to do.
Answer posted by Support on Jun 28, 2008 04:29
>>In paging mode how does the grid determine which rows or pages are cached and which aren't?
There is an inner buffer
    grid.rowsBuffer
If there is no record at necessary index - row will be fetched from server.
    if (!grid.rowsBuffer(index)) call_server();

>>Is there a way to fool the grid into thinking that the previously viewed rows or pages have not been loaded?
You can use code similar to next
function clearRow(grid,index){
    var row=grid.rowsBuffer[index];
    if (!row) return;
    grid.rowsAr[row.idd]=null;
    grid.rowsBuffer[index]=null;
}

....
clearRow(mygrid,0);   // remove first row from buffer, so it will be reloaded from server