日期:2014-05-16  浏览次数:20331 次

jquery easyui datagrid 刷新表格之后,再选中指定行?
$('#detail').datagrid("reload");
$('#detail').datagrid('selectRow', index);

这样的效果是被刷新了,但是没有选中index行。

------解决方案--------------------
放到onLoadSuccess事件中,要不reload加载的数据都没返回就已经执行$('#detail').datagrid('selectRow', index);这句代码了

$('#detail').datagrid({
onLoadSuccess:function(){
  if(window.index)$('#detail').datagrid('selectRow', index);
 }
//......其他
})