PDA

View Full Version : How to change page and limit values before loading Store



tsuryap
7 May 2015, 5:21 AM
Hi,

How to change the page and limit vales of store before loading the store. At one some point I want to change page =2 to Page =1 and limit values .

Is there any way to change limit and page of store dynamically

chamacs
7 May 2015, 9:38 AM
These are on the store's proxy. You should try this:



var store = // get the store reference for loading
var proxy = store.getProxy();
proxy.setExtraParams({
page : 2,
limit : 100
});
store.load();


or via store.loadPage(....).

Hope this helps.

tristan.lee
11 May 2015, 4:14 AM
I would recommend this in either the load (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Store-method-load) or loadPage (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Store-method-loadPage) methods:


store.load({
page: 2,
limit: 100
});

or


store.loadPage(2, {limit: 100});