How to maintain the checkbox selection after the page refresh / reload / redirected from some other page in JQGRID.
I am working in aspx
pages.
I am able to maintain the checkbox selection state in paging using following code:
gridComplete: function () {
var currentPage = $(this).getGridParam('page').toString(); //retrieve any previously stored rows for this page and re-select them
var retrieveSelectedRows = $(this).data(currentPage);
if (retrieveSelectedRows) {
$.each(retrieveSelectedRows, function (index, value) {
$('#list').setSelection(value, false);
});
}
},
onPaging: function (a) {
var pagerId = this.p.pager.substr(1); // ger paper id like "pager"
var pageValue = $('input.ui-pg-input', "#pg_" + $.jgrid.jqID(pagerId)).val();
var saveSelectedRows = $(this).getGridParam('selarrrow'); //Store any selected rows
$(this).data(pageValue.toString(), saveSelectedRows);
}
But, how to maintain the checkbox selection state in page refresh / redirect / reload in JQGrid
?
Also, I tried the following code on Window.OnLoad
, but it is not working
$("#list").trigger("reloadGrid", [{page: 1, current: true}]);