PDA

View Full Version : custom sort on grouping view



actonwang
25 Oct 2010, 7:15 AM
hi,

how could I do custom sort for sections on grouping view for the grid?

thanks
Acton

actonwang
25 Oct 2010, 7:19 AM
actually, more generically, how to do custom sort on any field?

Condor
25 Oct 2010, 7:38 AM
Specify a sortType function on the field.

actonwang
25 Oct 2010, 7:40 AM
thanks. any quick example?

Condor
25 Oct 2010, 7:44 AM
{name: 'state', type: 'string', sortType: function(v) {
switch (v) {
case 'Active': return 1;
case 'Stalled': return 2;
case 'Inactive': return 3;
default return 4;
}
}}

actonwang
25 Oct 2010, 7:46 AM
thanks!

actonwang
26 Oct 2010, 6:53 AM
I'd say it is amazingly quick response speed here. very impressive :) hope I will be a supporter later after I get handle of the extjs :)