【发布时间】:2015-09-01 10:56:23
【问题描述】:
我有一个带有五列的 jqgrid 以及 edit 列,编辑列的每一行都有一个编辑按钮。
假设我在 jqgrid 中有一些记录,并且我在 jqgrid 的第 4 页。单击第 4 页上某行的编辑按钮时,将调用一个操作方法,该方法执行某些功能并重新加载页面。
jqgrid 也被重新加载并从第 4 页进入第 1 页,即使在重新加载后如何保持同一页面。
我无法在互联网上找到这种确切情况的答案。
请帮忙!!
提前致谢。
$("#productvariationListGrid").jqgrid(
{
url: '../Product/GetAllProductType',
sortname: 'Name',
sortorder: 'asc',
colNames: ['Id', 'Product Name', 'Product Type Name', 'Description', 'Edit'],
colModel: [
{ name: 'Id', key: true, hidden: true },
{
name: 'ProductName', index: 'ProductName', searchoptions: { sopt: ['cn'] }, resizable: false
},
{
name: 'productTypeName', index: 'productTypeName', searchoptions: { sopt: ['cn'] }, resizable: false
},
{
name: 'Description', index: 'Description', searchoptions: { sopt: ['cn'] }, resizable: false
},
{
name: 'Edit', index: 'Edit', sortable: false, search: false,
formatter: actionFormatterEdit
}
],
rowNum: 5,
autowidth: true,
width: '100%'
});
function actionFormatterEdit(cellvalue, options, rowObject) {
return '<a href="../Product/EditProductType?ProductTypeId=' + options.rowId + '" class="editIcon"></a>';
【问题讨论】:
-
考虑使用 ajax 发布表单以便您留在同一页面上,否则将指示当前页面的值传递给控制器 POST 方法
标签: jquery asp.net-mvc-3 jqgrid