Grid Pagination Using Different Params for start and limit
I am building a grid with pagination using a PagingToolbar and a Store created from a ScriptTagProxy using a JSONReader. My problem is that the remote json feed is a google base feed and I cannot change the pagination parameters that it expects: start-index and max-results instead of the start and limit that Ext wants me to use. My question is, is there a way I can change these parameter names, I know that the ScriptTagProxy supports changing the callback parameter name so I was hoping that this sort of functionality would also be supported by the PagingToolbar or Store objects.
I can figure out how to send the appropriate parameters to the server but there is something built into either the Grid, Store, or PaggingToolbar that is looking for the 'start' property in the params object and it's causing me huge headaces ( I have to apply something directly to my forehead ). Anyway the PaggingToolbar will display the total number of records fine and the total number of pages correctly but the text 'Displaying 1 - 25 of 151' looks like this 'Displaying NaN - NaN of 151' and the Page textbox on the toolbar shows the same thing 'NaN' instead of a page number. I believe that this is because something cannot calculate the starting index for the grid because I am not passing the 'start' parameter. Any help in figuring out how I can fix this would greatly be appreciated.
You still have to set those properties, regardless of whether you're passing additional ones to the server (and ignoring start and limit). Alternately, you could modify the code of PagingToolbar to use different names.
So I figured out that PagingToolbar will use the start and limit even if you never pass them in the original params object when calling the Store.load() method. I can understand why it is done the way it is but I think that I might not be the only person who might want to use different names instead of start and limit. Also figured out that PagingToolbar always assumes a zero indexed list of results. i.e. if you want your first page index to be 1 instead of 0 you are going to run into issues. Again, my case is a little unusual b/c I cannot change the server-side code I'm using google base as the server I'm sending my requests to so these are issues pertaining to integrating the PagingToolbar with data comming from google base.
I have the same problem, I use a server of which I do not have control
and this server uses ":START" and ":LIMIT" in the place of start and limit.
I see it's possible to change params using beforeload event.
Can I have more explications? A sample code?
Thanks a lot