Hello,
Can the phpgrid vertical scroll bar maintain its position when the grid
autorefreshed by setTimeout("jQuery('#list1').trigger('reloadGrid',[{page:1}]);",1000);?
Thanks in advanced.
H.A
Hi,
This is doable but need to override loadcomplete event.
working sample is here.
http://www.phpgrid.org/demo/demos/misc/keep-vertical-scroll.php
<script>
function do_onload()
{
if (jQuery(window).data('phpgrid_scroll'))
jQuery('div.ui-jqgrid-bdiv').scrollTop(jQuery(window).data('phpgrid_scroll'));
setTimeout("jQuery(window).data('phpgrid_scroll',jQuery('div.ui-jqgrid-bdiv').scrollTop()); jQuery('#list1').trigger('reloadGrid',[{jqgrid_page:1}])",3000);
}
</script>
btw, the event controlling is currently part of licensed version (unless you find some hack in free build)
Abu,
This works great, but, if you have selected (ticked) some of the rows they get de-selected every time the timeout occurs…
Any ideas?
Chris
I've updated the demo on website and emailed you updated grid sample code.
http://www.phpgrid.org/demo/demos/misc/keep-vertical-scroll.php