Hybrid View
-
26 Mar 2007 9:03 AM #1
Grid: Paging of JavaScript Array already in memory
Grid: Paging of JavaScript Array already in memory
Hello,
i want to page the contents of a Java Script array with 50 rows (no server side paging here) directly on the client, showing the array in pages of 15 entries.
My problem now is, that the grid always shows all of the 50 objects within the Data.Store, although i defined:
ds.load({params:{start:0, limit:15}});
I use a regular ArrayReader and a MemoryProxy.
Funny thing is, the footer displays the correct number of entries in the array and the page numbers are also correct. But unfortunately i can´t skip through the in memory data.
Can anybody help me here?
What do I have to do, to enable Client Side paging?
The relevant code i currently use for this:
Code:var ds = new Ext.data.Store({ proxy: new Ext.data.MemoryProxy(myJavaScriptArray), reader: new Ext.data.ArrayReader( {totalProperty: 50', id: 0}, [Â… //some more code here ... ] grid.render(); var gridFoot = grid.getView().getFooterPanel(true); // add a paging toolbar to the grid's footer var paging = new Ext.PagingToolbar(gridFoot, ds, { pageSize: 15, displayInfo: true, displayMsg: 'Displaying topics {0} - {1} of {2}', emptyMsg: "No topics to display" }); // trigger the data store load ds.load({params:{start:0, limit:15}});
-
26 Mar 2007 11:02 AM #2
correct me if I'm wrong but the grid is using remote paging with the HttpProxy only.
I'm not a 100% sure about this but local paging isn't working.
-
26 Mar 2007 11:23 AM #3
Thanks for the answer.
Can anybody confirm, that local paging is not supported? I mean it´s almost working as far as the footer navigation goes.
And, if local paging is not supported, can one give me a hint on how to implement this? I mean, the data is already in the proxy and the reader would have to skip through the array somehow...
-
28 Mar 2007 4:48 AM #4
Local paging is NOT supported.... but my guess is that it will be in an upcomming release/revision as this question has been asked several times now...
-
28 Mar 2007 5:08 AM #5
I don't understand why you'd want it. Given that the data is there in the page, surely it's more convenient and intuitive to use the scrollbar for the purpose for which it was provided?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Mar 2007 10:55 AM #6
Yeah, I agree with you Animal. However my table has LOTS of columns (e.g.25) and when stuffing in 1000 rows all at once the rendering takes a lot of time. So paging with 50 or so shown on one page is my only way out of this misery.
I have no possibility of paging the data sets through another server round-trip, because it is not possible within my application architecture (as strange as this sounds).
-
29 Mar 2007 12:33 PM #7
Another reason to support "in-memory-paging" is to make it possible to load the first page of the grid during the initial loading of the page, instead of running an extra ajax call after the page has been loaded.
Thanks
Marco
-
29 Mar 2007 12:40 PM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Forest Grove, OR
- Posts
- 1,038
- Vote Rating
- 0
That'd be more complicated as you'd need to switch from a memory proxy to an http proxy for subsequent calls.
Originally Posted by mdissel
Jeff Howden
Ext JS - Support Team Volunteer
jeff@extjs.com
Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.
Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.
-
17 Apr 2007 8:12 PM #9
-
17 Apr 2007 11:53 PM #10
Well, it will move the server load.
The extraction of the whole dataset from the database, and the downloading of the data into the browser happen up front before the page is rendered, rather than on demand, and only if the user decides to view more pages.
Similar Threads
-
[SOLVED] Memory Leak in Paging Grid Example?
By cobnet in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 3 May 2007, 8:24 PM -
Grid DataModel keeps data in memory
By tane in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 24 Feb 2007, 12:38 PM -
How to call array-grid?
By sailaja in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 16 Jan 2007, 6:56 AM -
Array-Grid in YUI
By sailaja in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 10 Jan 2007, 3:18 AM -
Array Grid Example
By qintnt in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 4 Dec 2006, 5:06 AM


Reply With Quote

