Determine and set scroll position of a grid on page load.
Posted: Thu Sep 03, 2015 6:42 pm
I am working on maintaining page position for an edit favorites page. Alex helped me with it a couple of weeks ago and it works like a charm.
window.savedPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 5; (For onSubmit)
if (window.savedPos != null) {
setTimeout(function() {
window.scrollTo(0, window.savedPos);
}, 100);
}
(For onLoad)
However, the main grid for the screen has a scroll bar and if a user is at the bottom of the grid and the page loads, the scrollbar is reset to the top. I need to retrieve and set the scrollbar position for the grid on when the page reloads. There is a property on it called scroll tool tip, but I don't know how to access the value of it from javascript. Any suggestions?
window.savedPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 5; (For onSubmit)
if (window.savedPos != null) {
setTimeout(function() {
window.scrollTo(0, window.savedPos);
}, 100);
}
(For onLoad)
However, the main grid for the screen has a scroll bar and if a user is at the bottom of the grid and the page loads, the scrollbar is reset to the top. I need to retrieve and set the scrollbar position for the grid on when the page reloads. There is a property on it called scroll tool tip, but I don't know how to access the value of it from javascript. Any suggestions?