PDA

View Full Version : Grid Column multi sort



yulrizka
1 Jul 2011, 2:35 AM
Hi I'm new on this forum,

I have a question, is there any way to do multiple sorting on a grid. I don't mean on the store, but the column model. The default is when we click on a column, the grid will be sorted by the column., and the row will have '^' Symbol.

I've see on the example on multiple sorting using drag-drop. and it quite complex, I want to sort on multiple column by just clicking on the grid column. is this possible ?

skirtle
5 Jul 2011, 9:58 AM
It certainly is possible, I've seen it done, but it isn't trivial. You'll need to do a lot of the work yourself.

A starting point might be adding a listener for headerclick. The thread below starts with an example of someone trying to make a slightly different change to sorting when the header is clicked but the basic approach may well carry across:

http://www.sencha.com/forum/showthread.php?138644

I wouldn't bother reading the entire thread, the code in the original post should give you the starting point you need. The actual sorting will need to be applied to the store.