PDA

View Full Version : Grid Paging Toolbar setting page & start as NaN



netemp
4 Oct 2011, 3:44 AM
I have a grid with paging toolbar at the bottom. There is a 'Load' button at the top and user can load the grid clicking at this button.


Thus, initially there are no values present in the grid, but in such condition too the paging toolbar displays Page 1 of 1, and also the icons to go to 'next' or 'last' page are enabled.


Due to this, when user clicks any of these icons, then, though the records are not loaded but internally the values of 'page' and 'start' are set as NaN and if then user clicks at 'Load' button then these NaN values get passed to the server which is not what is expected.


That is, ideally, it should pass page=0&start=0 where as it passes page=NaN&start=NaN. The server doesn't recognize these values and throws error.


One quick fix for this is the modification of the code at the server side, but currently that is beyond the scope of our team work and we were just wondering if before loading the store, could we modify the values of 'page' and 'start' variables and pass 0 instead of NaN?


I tried accessing these parameters in beforeload event of the grid store, but there I could find the properties like - startParam or pageParam - but couldn't locate any method of accessing/modifying there values.


Or,


How to have 'next', 'last' icons at paging toolbar disabled when the grid has no records?


Could someone guide that how this could be resolved.


Thanks in advance.


PS: ExtJS Version used is 4.