I have a jqgrid with five columns along with edit column, there is an Edit button in each row of Edit column.
Suppose I have some records in jqgrid, and I am on page 4 of jqgrid. On clicking edit button for some row on page 4, an action method is called which performs some function and reloads the page.
The jqgrid is also reloaded and comes to page 1 from page 4, how to persist that same page even after reload.
I am not able to find answer for this exact scenario on internet.
Please Help !!
Thanks in advance.
$("#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>';