How do I maintain the scroll state each time jqgrid
is refreshed? I tried the following:
var scrollPosition = $("#"+grid_id).closest('.ui-jqgrid-bdiv').scrollTop();
$("#"+grid_id).trigger("reloadGrid", [{current:true}]);
$("#"+grid_id).closest('.ui-jqgrid-bdiv').scrollTop(scrollPosition);
But it doesn't work and the scroll bar moves back to the top after the grid is refreshed.
Also, $("#"+grid_id).closest('.ui-jqgrid-bdiv').scrollTop();
outputs 0
each time, though the grid has a scroll bar. Is the selector argument ($("#"+grid_id)
) incorrect? What should be in there?