【发布时间】:2011-06-16 19:03:31
【问题描述】:
我无法为 jqgrid 配置每页的项目。我的 jqgrid 是:
jQuery('#EmployeeTable').jqGrid({
url: '/Admin/IdeasJSON',
datatype: 'json',
postData: { page: page, pageIndex: pageIndex, Filter: Filter, DateStart: DateStart, DateEnd: DateEnd, TagID: TagID, StatusID: StatusID, CategoryID: CategoryID, IsDescription: IsDescription },
loadComplete: function () { pageIndex = null },
jsonReader: {
page: "page",
total: "total",
records: "records",
root: "rows",
repeatitems: false,
id: ""
},
....
然后 MVC 方法返回:
var result = new JsonResult()
{
Data = new { page = page, total = total, records = totalCount, rows = IdeaForJSONs }
};
result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
return result;
IdeaForJSONs 有 50 个元素。 我不知道为什么,但网格显示 20 个元素。为什么?
【问题讨论】:
-
默认设置为20,你要根据你的数据来设置。
-
对,
rowNum选项默认为20。
标签: jquery asp.net-mvc jqgrid