我在 MVC 4 jqgrid 中创建应用程序,我想根据数据大小或用户选项设置行列表(在 web.config 键、值中设置值)。我尝试使用函数传递值,但我在下拉列表中获取值像这样。请帮助我。
代码:
Method;
function setRowList() {
var rownum = "[5,10]";
return rownum;
}
MY grid:
$("#ApplicationDetailsTable").jqGrid({
url: '@Url.Action("AppListDetails", "JQGridHome")',
datatype: 'json',
colNames: ["no1", "name", "phone"],
colModel: [
{ name: "no1", index: "no1", width: 40, align: "left", stype: 'select', searchoptions: { sopt: ['eq'], value: categoriesStr } },
{ name: "name", index: "name", width: 100, align: "left" },
{ name: "phone", index: "phone", width: 200, align: "left" }
],
width: 550,
loadonce: true,
height: 200,
toppager: false,
pager: $("#JQGridPaging"),
rowNum:4,
rowList: setRowList(),
viewrecords: true,
caption: "A Basic jqGrid - Read Only",
图片