排序后无法选择dhtmlxGrid中的第一行

排序后无法选择dhtmlxGrid中的第一行,grid,dhtmlx,Grid,Dhtmlx,我尝试使用以下代码选择网格排序后的第一行 dhtmlx.image_path='./codebase/imgs/'; var main_layout = new dhtmlXLayoutObject({ parent: document.body, pattern: "1C", cells: [{id: "a"}] }); var selectionGrig = main_layout.cells('a').attachGrid(); with (selectionGr

我尝试使用以下代码选择网格排序后的第一行

dhtmlx.image_path='./codebase/imgs/';

var main_layout = new dhtmlXLayoutObject({
   parent:  document.body,
   pattern: "1C",
   cells: [{id: "a"}]
});

var selectionGrig = main_layout.cells('a').attachGrid();

with (selectionGrig){
   attachEvent("onAfterSorting", 
       function(index,type,direction){
          selectionGrig.selectRow(0);
       }
   );
   setIconsPath('./codebase/imgs/');
   setHeader("Show,Group,Date,Time,C1,S,C2,L,H");
   setColTypes("ch,ro,dhxCalendar,ro,coro,ro,ro,ro,ro");
   setColSorting('int,int,date,time,int,str,int,str,int');
   setDateFormat('%d %M %Y','%Y-%m-%d');
   updateFromXML('./data/tmp.xml', true,false, function(){selectionGrig.groupBy(1);});
   init();
 }
}

但是,无论这一行的位置如何,排序后它总是选择同一行,而不是第一行。

尝试从onAfterSorting回调调用下一个代码

selectionGrig.selectRow( selectionGrid.rowsCol[0] );