Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by raj on May 08, 2008 03:49
open dhtmlx forum
secondary sorting on a grid

Hi,

I am using dhtml xgrid,

I have a grid with 5 columns, I have column sorting on all the columns and also I need to sort a particuler column based on another column

that means, I need a secondary sort on particuler column, when some other column is sorted.

Let me know, is this possible using dhtml xgrid?

 

/Thanks

Raj

 

Answer posted by Support on May 08, 2008 09:33
You can switch grid to stable sorting mode
    grid.enableStableSorting(true);
And sort by column in necessary order
    grid.sortRows(B,"str","asc");
    grid.sortRows(A,"str","asc");

where A,B - indexes of column
In result grid will be sorted by column A , and rows which are equal in column A, will be sorted by column B