Page 1 of 1

Determine and set scroll position of a grid on page load.

Posted: Thu Sep 03, 2015 6:42 pm
by brianhd71
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?

Re: Determine and set scroll position of a grid on page load.

Posted: Thu Sep 03, 2015 9:11 pm
by Antonio
There is a property called "position at top" for the subfile grid that allows you to set the scrollbar position for the subfile grid by choosing what record is shown in the first row of the grid. If you could send us a JSON screenshot of the screne in question you are working with, we can take a look at it and get a better idea of what you are describing and see if this is what you need.

To get a JSON screenshot simply open up your screen in the designer, select "Save As" at the top of the designer, select the local tab and save the file on your Local PC. Attach that file to a post here.

Re: Determine and set scroll position of a grid on page load.

Posted: Fri Sep 04, 2015 10:52 am
by brianhd71
Here you go.
Thanks.