PDA

View Full Version : how can i remove the sort in a grid panel



EmCy90
27 Sep 2011, 6:25 AM
The each column in the grid panel can be sortable and you can sort the that according that column, but let's say that after i have sorted the data i decide that i like them the old way with no sort how can i remove the sort ?

B.W.
27 Sep 2011, 7:04 AM
You could try reloading the grid (easy for finite data) or set up a mechanism (cookie, array, Store field 'previousPosition', etc) that remembers where the fields were before the sort took place

EmCy90
27 Sep 2011, 7:10 AM
There are several thing that i have in mind but first i wanted to ask if there wasn't some method that i missed in the docs.

twaindev
27 Sep 2011, 10:49 AM
You can clear the sorters to remove any sorting:


store.sorters.clear();

EmCy90
28 Sep 2011, 3:21 AM
The clear of the sorters helped me dig a little deeper. There also is need after the sorters are clear to find the column by which the grid was sorted and set it's sort state to null and the the data is returned to normal.