0
votes

My grid store has a default pageSize property. On the server side I return totalProperty parameter. So, pagination is working correctly. But, I've just built a custom filter which is supposed to specify different parameters of the grid, including pageSize. And this is not working. In fact, I do not know how to redifine store pageSize when using loadData function. The whole function which reloads grid looks like this

var grid=Ext.getCmp('grid'),
frm=Ext.getCmp('remotefilter').getForm(); // this form contains grid
// parameters which can be redifined by user     
frm.submit({
  url:'../json/grid.php', // this code returns grid data, based on parameters
  submitEmptyText:false,
  success:function(form,action){
    var json=Ext.decode(action.response.responseText,1);
    grid.getStore().loadData(json['items']);
    // I guess, here I should specify new pageSize somehow
    // I can grasp a new value of pageSize from the form above
  }
}); 

EDIT

I also tried to do this just before invoking loadData:

grid.store.pageSize=newlimit;       
Ext.getCmp('pagingToolbar').pageSize=newlimit;

But it does not help

2

2 Answers

0
votes

specify segment of data you want to load using params

store.load({ params:{ start:0, limit: itemsPerPage } });

0
votes

try grid.getStore().pageSize = newlimit. the store is shared with the paging toolbar.