PDA

View Full Version : Paging for grid (memory store)



env0ke
25 Aug 2011, 5:09 AM
Hi all,

I create simple "memory" store with 500 rows. I set for store "pageSize: 50". But when i create grid for this store, i see all 500 rows in every page. How can i set correct paging for grid?

My store:

Ext.create('Ext.data.Store', {
model: 'FPS.model.Subscriber',
autoLoad: true,
LoadMask: true,
pageSize: 50,
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'data',
totalProperty: 'total'
}
},
data: [...]
});

skirtle
27 Aug 2011, 9:14 AM
It doesn't work that way. If the store contains records they will all be used, no matter what paging settings you use.

Paging is done by sending parameters to the proxy, which may then choose whether or not to respect them. Local paging is discussed in the docs for the pagingtoolbar:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.toolbar.Paging

I think your best bet is example/ux/data/PagingMemoryProxy.js.