我在 MVC3 中工作并使用 jqGrid 4.4.1,我是 jqGrid 的新手,所以这是基本问题。
我已成功将数据传输到 Grid 并显示第一个站点。但是当我点击下一页时,我没有得到任何回应。
var myMeasurementsGrid = $("#gridMeasurementsTableView" + randomId);
myMeasurementsGrid.jqGrid({
url: '/DataMonitor/CreateMeasurementTableView/',
datatype: "json",
mtype: 'POST',
postData: { "mrpId": dataToSend.mrpId, "chartId": dataToSend.chartId, "mrpStartTime": dataToSend.mrpFilter.FilterTimeWindow.StartTimeStamp, "mrpEndTime": dataToSend.mrpFilter.FilterTimeWindow.EndTimestamp },
jsonReader : {
root: "data",
page: "Page",
total: "total",
records: "records",
repeatitems: false,
cell: "cell",
id: "id"
},
colNames: ['Date', 'Value'],
colModel: [
{ name: 'Timestamp', index: 'Timestamp', width: 260,
formatter: function (cellvalue, options, rowObject) {
return new Date(parseInt(cellvalue.substr(6, cellvalue.length - 8), 10));
}
},
{ name: 'Value', index: 'Value', width: 160, align: 'center' }
],
loadui: "disable",
loadtext: "Loading",
viewrecords: true,
gridview: true,
rowNum: 10,
height: "100%",
caption: "Measurements2",
pager: $("#gridpager" + randomId),
loadonce: true,
sortname: 'Timestamp',
sortorder: "asc",
rowList: [10, 50, 100]
});
后面的函数是:
[HttpPost]
public ActionResult CreateMeasurementTableView(string sidx, string sord, int page, int rows, int mrpId, string divId, string chartId, DateTime mrpStartTime, DateTime mrpEndTime)
{
... here is my code, for getting data
return Json(new
{
total = listaAvailableMeasurements.Count(),
records = listaAvailableMeasurements.Count(),
data = listaAvailableMeasurements,
Page = page,
SortColumn = sidx,
SortOrder = sord
});
有谁知道,为什么导航没有响应?
兄弟,一月