PDA

View Full Version : paging and remoteSort



saubua
10 Mar 2007, 9:48 AM
Hello,

great framework!

I'm using a store with a PaingToolbar. Everything works fine so far, but I can't figure out how to force the grid to page 1 after clicking on a sortable header.
If I'm on page 2 it fire the correct request, but it stays on page 2. I want it to go to the beginning.

Any ideas?

thanks,
saubua

Animal
10 Mar 2007, 10:28 AM
Where dataSource is your DataSource and myPageSize is your page size:


dataSource.load({params:{start: 0, limit: myPageSize}});

saubua
10 Mar 2007, 10:59 AM
Where dataSource is your DataSource and myPageSize is your page size:


dataSource.load({params:{start: 0, limit: myPageSize}});


OK, thanks.
But where should I put this line of code?

Ext.Store.sort() calls Ext.store.load() calls proxy.load()
and proxy does not know anything about sorting...

cembry@opentext.com
21 Jun 2011, 2:50 PM
Did you ever find a solution to this? I am looking for the same thing.

Vital Aaron
14 Oct 2011, 12:08 PM
If you're looking for a 4.x solution to this problem (and given the date of your post, I kind of hope you are) then add the following to your store definition:



doSort: function() {
this.currentPage = 1;
this.callParent(arguments);
}


This works if your store is defined as an extension of Ext.data.Store:


Ext.define('pagingStore', {
extend : 'Ext.data.Store',...
}
yourStore = Ext.create('pagingStore');