PDA

View Full Version : [FNR] Grid sort state not apllied



Stephan Stückmann
21 Jul 2011, 10:03 AM
Hi,

we have a problem with applying the saved sort state of our grid, which uses clientside paging with a PagingModelMemoryProxy and BasePagingLoader.

In Grid.doApplyStoreState() there is this line:


if (store.getLoader() == null && sortField != null)...

I think this should be:


if ((store.getLoader() == null || !store.getLoader().isRemoteSort()) && sortField != null)...

Or just skip the loader check, because in ListStore.sort() there is a check for the loader already?

Kind regards,

Stephan

sven
21 Jul 2011, 10:23 AM
Or just skip the loader check, because in ListStore.sort() there is a check for the loader already?

This is going to be a braking change.


However i will add the check if its not using remote sort as this is realy missing

sven
21 Jul 2011, 10:24 AM
Index: user/src/com/extjs/gxt/ui/client/widget/grid/Grid.java
===================================================================
--- user/src/com/extjs/gxt/ui/client/widget/grid/Grid.java (revision 2379)
+++ user/src/com/extjs/gxt/ui/client/widget/grid/Grid.java (working copy)
@@ -746,7 +746,7 @@

protected void doApplyStoreState(Map<String, Object> state) {
String sortField = (String) state.get("sortField");
- if (store.getLoader() == null && sortField != null) {
+ if ((store.getLoader() == null || !store.getLoader().isRemoteSort()) && sortField != null) {
String sortDir = (String) state.get("sortDir");
SortDir dir = SortDir.findDir(sortDir);
store.sort(sortField, dir);

sven
21 Jul 2011, 10:34 AM
Fixed in SVN as of revision 2415

Stephan Stückmann
22 Jul 2011, 12:25 AM
That was fast, thanks! :)