In my app, everything should be dynamically. I’m creating a view like this:
this.store = Ext.create('Test.store.Users');
this.model = Ext.ModelManager.getModel(this.store.model);
this.view = Ext.create('Test.view.Users.Index');
this.view.init();
Ext.create view creates a grid and the init function creates a pagination toolbar:
init: function(){
var pToolbar = new Ext.PagingToolbar({
dock: 'bottom',
store: this.store,
displayInfo: true
});
this.addDocked([pToolbar]);
}
this.store has the right reference (checked it) and refreshing is working great but pagination does not! I’m always getting all results, not paginated. I’ve tried something like this inside init():
//bind a store to a toolbar
pToolbar.bindStore(this.store);
//reconfigure grid
this.reconfigure(this.store);
//load just the first page
this.store.loadPage(1);
Same thing. I’m getting all 240 records instead of 25. Any ideas?
Thank you.
You have to pass
startandlimitparameters while loading the store. Also mentionpageSizein store configuration or set is dynamically. You can load store like –If you are receiving data in response from server, then on server side you have to build
selectquery according tostartandlimitparameters.