PDA

View Full Version : Grid Multi Sort Question



parky128
13 Jul 2011, 4:59 AM
Hello,

I need to intercept a store's sort event, triggered by a user clicking on a grid header of a sortable column, or at least I think I do anyway!

I can't see any sort or beforesort type events on the store object in the API docs, I see the datachanged event but this will probably be too late for me as a sort will have already been performed by then.

I just need to apply a secondary sort to the store after the user, clicks on one of the columns headers in the grid, so if the click Column 1, the store will sort by that field in which ever direction and then I can apply an additional sorter as well.

I thought about trapping the grid headerclick event and stopping the event and then performing my custom sorting on the store afterwards, but the stopEvent() function on the event object (passed into the headerclick event) doesnt prevent the initial sort from happening.

Can anyone offer any advice please?

Thanks

skirtle
17 Jul 2011, 1:23 AM
Two suggestions.

You could subclass store and override the sorting methods.

You could set the column to sortable: false, then use a headerclick listener.