View Full Version : grid.reconfigure() does not reset store's sorters

9 Jun 2011, 9:25 AM
1. I have a grid, and I sort on column A.
2. I reconfigure the grid and store, and column A is not part of the new configuration.
3. The store still includes column A's dataIndex in the "sort" parameter when making calls to the server, even though column A is no longer valid.
4. Server complains when trying to sort on invalid field.

Ideal fix: when the grid is reconfigured, the store's sorters collection is checked - any sorters that still match fields in the store are kept, other sorters are removed.

Fix: call store.sorters.clear() somewhere within the reconfigure() function. This is what I'm doing as a work-around before calling reconfigure(). Perhaps add a flag to the function to make it optional.