Hiding sort arrows on grid columns

I do not want to have sorting on some of the grids in my application. While I have suppressed the sort action, the up/down sort arrows are still appearing in the column headers.

I tried using setSortImgState(false) but it did not work:

   	    		rulegrid = ruleGridLayout.cells("a").attachGrid();
	    		rulegrid.setEditable(true);
    			rulegrid.setDateFormat("%m/%d/%Y");
    			rulegrid.enableResizing("true,true,true,true,true,true,true,false");
    			rulegrid.setSortImgState(false);
    			rulegrid.init();
    			rulegrid.setSkin("light");
    			rulegrid.setStyle("", "", "", "background-color:#fff8e2; border-color:#5286c8; border-width:1px;");
    			rulegrid.enableAlterCss("even", "uneven");
    			rulegrid.attachEvent("onRowSelect", ruleSelected);
    			rulegrid.attachEvent("onDhxCalendarCreated",function(obj,rowId,cellInd){
	  		      		obj.setSkin('');  // set calendar to default skin
    		   	});

The arrows do not show up initially, but when you click on the column header they show up.

I saw another post where the recommendation was to replace the image files with “transparent” images, but I cannot do this as I have other grids in my application where I DO want the sorting.

You can easily configure sort arrow by setSortImgState() method
http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_setsortimgstate

Please see the details of my post… yes I did use it and it isn’t working for me.

I’m using: setSortImgState(false)

mygrid.setSortImgState(false); is not working for me either. Should there be another support file besides the required library file: dhtmlxgrid.js? I have a multiple row header and am wanting to hide the sort arrow (both ascending & descending) on a particular header cell so I would like to define it by row/column. Every variation of mygrid.setSortImgState() is not working for me.

Is there a fix for this available?

Try to use following code:

grid.attachEvent("onBeforeSorting",function(){ grid.setSortImgState(false); return true; })

This is not working either :frowning:

I added this code and an “alert” message. When the grid is displayed and user clicks on a column, the alert message pops (indicating that the event was received OK). However, as soon as I dismiss the alert pop-up the sort arrow appears on the column.

Try to use such function:

mygrid.attachEvent("onAfterSorting", function(){ window.setTimeout(function(){ mygrid.setSortImgState(false); return true; },200) })

I don’t think it is still topical problem, however, you should put setSortImgState inside loadXML function, for ex.:

my_grid.loadXML("/my_xml_path", function(){ my_grid.setSortImgState(true, 2); });