1 function onLoadSuccess(data) { 2 var rows = $("#DataGrid").datagrid("getRows"); 3 if (rows.length > 0) { 4 rows = $("#DataGrid").datagrid("getSelections"); 5 if (rows.length == 0) 6 $('#DataGrid').datagrid('selectRow', 0); 7 } 8 else { 9 $('#dgGD').datagrid('loadData', { total: 0, rows: [] });10 $('#dgYS').datagrid('loadData', { total: 0, rows: [] });11 }12 }