【发布时间】:2014-02-05 08:36:26
【问题描述】:
好的,我将服务器端代码更改为
int nm = objects.ToList().Count;
if (objects.ToList().Count > 0)
return new PagedList(objects, nm, 1, 25, null);
else return null;
json 改为
{"d":{"total":15,"page":1,"records":366,"rows":[{"id":"34324","LastDateChange":"/Date(1391464800000 )/","DateLoad":"/Date(1391464800000)/"....,"AName":"fg"}],"userData":null}}
客户端
$("#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"
}
....
});
但是网格是空的!不明白;(,可能是样本?
【问题讨论】:
标签: c# javascript jquery asp.net jqgrid