Prevent Grid from refreshing

QuestionsPrevent Grid from refreshing
Greg asked 4 years ago

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.

1 Answers
Abu Ghufran answered 4 years ago

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>

Your Answer

9 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!