DHTMLX Grid - Default Sorting

I am loading a CSV into a DHTMLX grid. I have a column with a width set to 0 that contains ASCII data, that I want to sort by. I want the data sorted by default after the data is loaded, without the user clicking on anything.



I have tried: grid.setSortImgState(true,INDEX,“asc”); and also various combinations of: mygrid.sortRows(0);



But none seem to work. Any help would be appreciated.

If you are loading from remote CSV file|url - the loading is async, so you need to call the sortRows method only after data loaded, it can be done as

grid.load(“some.csv”,function(){
grid.sortRows(0,“str”,“asc”); //0 - index of column
},“csv”);