dhtmlxgrid setSortImgState


I needed to display the sort arrow by default as it was not showing when the grid loaded. I was able to get it to display but now when you click on another column, the grid re-sorts but the arrow stays on the default column.

dhtmlxgrid: //v.3.6 build 130619



So in the example, the sorting arrow does appear in the Date To column which is correct but then if you were to click on the Date From column you notice that the flag stays on the Date To one.

Thanks in advance.

Unfortunately the issue cannot be reproduced locally.

please, try to remove your code from the onAfterSorting event:
mygrid.attachEvent(“onAfterSorting”, function() {
window.setTimeout(function() {
return true;
}, 200)
without that code you are able to set the default position of the sort arrow:
mygrid.setSortImgState(true, 2, “des”, 1);
and not influence the sorting image on sorting of the griid clicking on a header.

Thanks for the reply and that seemed to do it!