Hi,
I have a grid setup where I have approximately 150 rows shows on each page. When a user is working on their data (at the bottom of the grid) so imagine it having scrolled to the bottom. When they click "edit" they are able to work on the row, but when they click save, it jumps them back up to the top of the rows.
Is there a way to disable this functionality so when it saves, the grid stays where it was previously being edited?
Thank you – Greg.
Pasting from faq:
##### Q) How to maintain vertical scroll position after grid reload?
First you need to get the handler for load complete.
$e["js_on_load_complete"] = "do_onload";
$g->set_events($e);
Then in callback, you can have following code.
<script>
function do_onload()
{
if (jQuery(window).data('phpgrid_scroll'))
jQuery('div.ui-jqgrid-bdiv').scrollTop(jQuery(window).data('phpgrid_scroll'));
jQuery('div.ui-jqgrid-bdiv').scroll(function(){
jQuery(window).data('phpgrid_scroll',jQuery('div.ui-jqgrid-bdiv').scrollTop());
});
}
</script>