确定我改变服务器端代码如何解决jqGrid排序,分页问题?
int nm = objects.ToList().Count;
if (objects.ToList().Count > 0)
return new PagedList(objects, nm, 1, 25, null);
else return null;
JSON是变化到
{ “d”:{ “总”:15, “页”:1, “记录”:366,“行“:[{” ID “:” 34324" , “LastDateChange”: “/日期(1391464800000)/”, “DateLoad”: “/日期(1391464800000)/” ..., “AName”: “FG”} ], “用户数据”:空}}
客户端
$("#table").jqGrid({
url: '/WebSrv.asmx/GetSaleObjects',
datatype: 'json',
mtype: 'POST',
loadonce: true,
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
serializeGridData: function (postData) {
},
viewrecords: true,
sortable: true,
gridview: true,
multisort: true,
height: 'auto',
width: 'auto',
pager: "#pgrf",
autowidth: true,
pagination: true,
jsonReader: {
root: "d.rows",
page: "d.page",
total: "d.total",
records: "d.records"
}
....
});
但网格是空的! `吨uderstand;(可能是样品