//初始化
$("#dataimglist").datagrid({
iconCls: "icon-table",
rownumbers: false,
singleSelect: true,
width: "100%",
height: 320,
sortOrder: 'asc',
url: "/InformationRelease/ResourcesFile/GetResourcesDetail",
queryParams: { ResId: 0 },
loadMsg: '数据正在加载,请稍后... ...',
remoteSort: false,
pageSize: 20,
pagination: false,
nowrap: false,
loadFilter: function (result) {
if (result.success) {//特殊数据格式
var data = JSON.parse(result.data);//真实数据
return data;
}
else {
errorMsg(result.showMsg);
return { total: 0, rows: [] };
}
}
});
刷新
$("#dataimglist").datagrid('options').queryParams = {
ResId: ResId
};
$("#dataimglist").datagrid("reload");
$("#dataimglist").datagrid("clearSelections");
不请求后台,直接绑定特殊格式
$('#dataimglist').datagrid('loadData', { success: true, code: 0, msg: null, showMsg: null, data: "{\"total\":1,\"rows\":[]}" });