onLoadSuccess:function(data){
var rowData = data.rows;
$.each(rowData,function(index,row){//遍历JSON
if(data.okflag==1){ //如果数据行为已选中则选中改行
//$("#dgSelectRoles").datagrid("selectRow", index);
$("#dgSelectRoles").datagrid("selectRecord", row.id);
}
});
},
本文介绍了一种使用JavaScript处理JSON数据的方法,并展示了如何在页面加载成功后通过ID选择Datagrid中的行。此过程适用于需要从后台获取数据并高亮显示特定记录的应用场景。

被折叠的 条评论
为什么被折叠?



