dhtmlxgird sorting after initial???

Dear Sirs~
When I click grid’s header to sorting, I got error as “this.rowsBuffer[…].idd is null” !!!
:cry: How can I sort by column with dynamic add rows???
This is how we init grid:
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("./codebase/imgs/");//path to images required by grid
mygrid.setHeader(“Name, Age, Salary”);//set column names
mygrid.setInitWidths(“100,50,100”);//set column width in px
mygrid.setColAlign(“right,left,left”);//set column values align
mygrid.setColTypes(“ro,ed,ed”);//set column types
mygrid.setColSorting(“str,int,int”);//set sorting
mygrid.init();//initialize grid
mygrid.setSkin(“light”);//set grid skin
mygrid.addRow(1,“Andy,23,5000”, 1);
mygrid.addRow(2,“Brad,25,4000”, 2);

In your grid when you adding the rows - the row with index “0” is absent.
Row index is a zero-based attribute. Please, try to use:

mygrid.addRow(1,"Andy,23,5000", 0); mygrid.addRow(2,"Brad,25,4000", 1);