dhtmlxGrid disable sorting for one column?

Ok, I’m hoping I can explain this clearly.

First, the code:

[code]mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath(“includes/dhtmlxGrid/codebase/imgs/”);
mygrid.setHeader(“Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8,Col9”);
mygrid.attachHeader("#text_filter,#text_filter,#select_filter,#select_filter,#text_filter,#select_filter,#text_filter,#select_filter,#select_filter,#text_filter,");
mygrid.setInitWidths(“100,45,,150,150,100,125,100,,1”);
mygrid.setColAlign(“left,left,left,left,left,left,left,left,left,left”);
mygrid.setColTypes(“link,ro,ro,ro,link,ro,link,ro,ro,ro”);
mygrid.setColSorting(“str,str,str,str,str,date,str,date,str,str”);

mygrid.init();
mygrid.groupBy(9);
mygrid.setSkin(“dhx_skyblue”);
mygrid.parse(data, “json”);[/code]
I am generating the data for this grid with ColdFusion by creating a JSON object. Col2 is the one that I would like to disable from sorting but keep the sorting of the other columns.

Col2 contains a simple cell that is colored to match information in the rest of the information of the column.

<cell class='my_#TheColor#'>       </cell>

This is the cell that is generated and the color is selected via a case statement during generation with ColdFusion. So, when searching on this field it’s trying to search through the HTML which is listed above.

The goal would be to a) Just disable the column or b) If there is some way to send just the colors (red,blue, white etc) to grid so that it could be sorted via a select drop down.

I can always add more information if needed.

Thanks!

For (b) check the custom sorting functionality
docs.dhtmlx.com/grid__sorting.ht … ngfunction
It will allow to define your own function for data sorting. Such function can use custom rules, and sort not only by data but by any other cell’s property ( any that is accessible through api )

For (a) just set sorting type as “na” to the column in question
mygrid.setColSorting(“str,na,str,str,str,date,str,date,str,str”);

Thanks. I changed the sorting line to this:

mygrid.attachHeader("#text_filter,,#select_filter,#select_filter,#text_filter,#select_filter,#text_filter,#select_filter,#select_filter,#text_filter,");

It was the posted above this that got me thinking.

Thanks!!