PDA

View Full Version : Secondary Sort?



HmblProgrammer
3 Apr 2008, 11:58 AM
Hey,

I tried to search for this but I'm not sure what it's technically called, so I didn't find many results.

I have a store, and a DataGrid, which I want to sort first by one column and then secondarilly by a second column... I.E. So I end up with:



Column1 | Column2 | Some Other Column
-------------------------------------
Value A | Some A | blah blah blah...
Value A | Some B | something else...
Value A | Some X | whatever else...
Value B | Some 1 | who knows what...
Value B | Some A | blah blah again...
Value C | 1 2 3 | this is all an example..


That is, when the values in Column1 are equal, then sort by Column2...

-Josh

devnull
3 Apr 2008, 12:14 PM
I dont believe that is possible in a store without extending the store, but it is pretty trivial for a sql database if you are using remote sorting.

3 Apr 2008, 1:35 PM
you'd need to extend the store and columnmodel to accommodate the sort order options. i recommend doing it via serverside only however.

If you wanted to do things easier, you could have a custom dialogbox/menu system that can take 'sort order' parameters and pass them along w/ the store.load method.