View Full Version : Grid sort type?
mabco
03-25-2009, 03:23 PM
I know there must be a way to configure a grid so that particular columns are sorted as numeric instead of as ascii text, which appears to be the default. First place I looked was ColumnConfig, expecting to find a setSortType() method, but it isn't there. I've scoured the API and the forums for the answer. Can someone point me in the right direction?
Just to be clear, I want the following:
1
2
222
33
to be sorted numerically as
1
2
33
222
micgala
03-26-2009, 03:50 AM
Hi.
If the data you add to the grid store is already a number (Integer for example) then you don't need to do anything...
Just make sure you add your numbers are real numbers instead of String....
Also, if this is not possible, there is a way to provide StoreSorter to your store.
Then you can implement the sorting yourself...
Hope this helps you.
Regards,
Michel.
mabco
03-28-2009, 03:12 PM
Michel, thanks for the reply. I haven't been able to try one of your solutions yet, but I'm hopeful that one of them will work, hopefully the first one as I shouldn't have to define my own sorting routine for something as basic as this. (:|
novandria
10-08-2009, 02:50 PM
Hey mabco,
Did you come up with something to fix your problem? I'm having a similar problem. The only difference is that my data are strings:
Example:
2GB
22GB
3GB
Thanks in advance.
You can add a custom store sorter in that you can define how the sort gets done.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.