I created a grid using dhtmlxGrid 1.6 and by default, I want the grid to be sorted by the first column. The sort works fine if the user manually clicks on the column header, but I can’t get it to initially display with the first column sorted. Here’s the code I’m using to initialize the grid:
My expectation was that mygrid.sortRows(0) would make it initially display with the first column sorted, but that doesn’t seem to work.
Grid loading is async., which means that the command next to the load will be executed in moment when data not loaded yet, the correct syntax will be
You can use onXLE event or second parameter of load function to achieve desired behavior
mygrid.load(‘browse_cams_xml.php’,function(){
mygrid.sortRows(0);
});