FYI, I’ve discovered that using addrow with an index that is out of bounds, causes an error in sorting. The code below will not sort unless you either remove the 4 (or replace it with 0-3) found in the last line
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.imgURL = “imgs/”;
mygrid.setHeader(“Model,Qty,Price”);
mygrid.setInitWidths(“100,150,150”);
mygrid.setColAlign(“left,right,right”);
mygrid.setColSorting(“str,str,int”);
mygrid.setSkin(“light”);
mygrid.init();
mygrid.addRow(123,“text9,textc,697”);
mygrid.addRow(124,“text1,textd,88”);
mygrid.addRow(125,“text3,texta,889”,4);
Do you have any special reason for providing not existing row index?
If you need to add row to the last position you can use
grid.addRow(id,values,-1);