【发布时间】:2013-03-15 12:34:33
【问题描述】:
我需要根据视图的选择动态填充网格。 我已按照以下链接动态填充网格。
Problem showing jqgrid with dynamic column binding
它使用两个 ajax 调用。一次获取 JqGrid 的 ColModel 和 ColNames,第二次调用获取 colData。 返回的数据只针对当前Page(即20条记录-Pagesize 20)。
我遇到的问题是我的服务器端分页无法正常工作。当我点击寻呼机上的下一个按钮时,只重新加载了第一页。
处理程序中的代码如下
var numberOfRows = context.Request["rowsPerPage"];
int nRows, iPage;
if (String.IsNullOrEmpty(numberOfRows) || !int.TryParse(numberOfRows, NumberStyles.Integer, CultureInfo.InvariantCulture, out nRows))
nRows = PageSize; // default value
var pageIndex = context.Request["pageIndex"];
if (String.IsNullOrEmpty(pageIndex) || !int.TryParse(pageIndex, NumberStyles.Integer, CultureInfo.InvariantCulture, out iPage))
iPage = 1; // default value
context.Request["rowsPerPage"] 和 context.Request["pageIndex"] 总是返回 null 并设置为默认值。 我错过了什么。请帮忙。
【问题讨论】: