PDA

View Full Version : paging toolbar, reset after sort change



dcoan
24 Aug 2010, 11:44 AM
When a user changes the sort field/direction of the grid (using column header for example)... I'd like to ALSO reset the grid so that the paging toolbar shows the first page.


I'm using remote sorting.

So, when I change the "sort" and "dir" params, I'd also like to change the "start" param to 0... AND... have the paging toolbar correctly display "page 1".

I've looked at the gridPanel.sortchange event, and the pagingToolBar.changePage and moveFirst() methods.
The event is firing ok...but I can't seem to get the handler to "talk" to the bbar (paging bar) correctly.

TIA

machi27
19 Oct 2010, 10:58 PM
hi,
add this is store

sort:function(fieldName, dir) {
if (this.remoteSort) {
options=store.lastOptions;
var pn = this.paramNames;
options.params = Ext.apply({}, options.params);
options.params[pn.start] = 0;
return Ext.data.GroupingStore.superclass.sort.call(this, fieldName, dir);
}

}

the above code will reset the start=0... and rest u handle in backend query