I have a problem with regards to maintaining the scroll position
of my jqgrid
.
Here is the objective of my program:
I have no problem with these steps (1-5)
My problem is that if I have extensive rows for example 500 rows. It will display the scroll bars on the side of the jgrid.
What I want to do is to maintain the scroll position of the scroll bars using Javascript or jQuery. How do I do this?
I tried to use this, on loadcomplete event
var scrollPosition = 0;
scrollPosition = jQuery("#jqgrid").closest(".ui-jqgrid-bdiv").scrollTop(scrollPosition);
jQuery("#jqgrid").closest(".ui-jqgrid-bdiv").scrollTop(scrollPosition);
but it doest give me the value of the scroll position
See . this fidle based on this article
<input type="submit" id="button"/>
<div id="div1"> </div>
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#div1").offset().top
}, 2000);
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.