Page 1 of 2

Refresh Scrollbar when Grid is refreshed

Posted: Fri Apr 26, 2013 11:06 am
by bluttman
I am using JavaScript to load 2 grids on my screen by building a SQL statement and updating the "custom sql" property on the grid and then refreshing.

The issue is that the scrollbar does not refresh. If you happen to be several pages down in the grid and the refresh loads fewer records you don't see any data without scrolling back up to the top. I have discovered a function that will move the scrollbar back to the top but I doubt it is supported :-), also if the resulting data set has fewer records than the grid displays the scrollbar should be disabled.

Would it be possible to have the grid.refresh() function refresh/rebuild/reset the scrollbar?

Re: Refresh Scrollbar when Grid is refreshed

Posted: Fri Apr 26, 2013 6:30 pm
by Scott Klement
Which function are you using to reset the scrollbar?

I'm giving some thought to how this should work, because sometimes you want it to stay on the same screen and not get reset to the top, other times you don't.

Re: Refresh Scrollbar when Grid is refreshed

Posted: Mon Apr 29, 2013 9:22 am
by bluttman
We found this function will set back to top:
getObj("SFL01").grid.e.cd();

However, it does not resize the scrollbar for the new contents of the grid. (i.e. if there is now less than a full grid of data the scrollbar should be gone...)

Thanks!

Re: Refresh Scrollbar when Grid is refreshed

Posted: Mon Apr 29, 2013 9:25 am
by bluttman
We also tried using functions like scrollTo and/or scrollTop but they were not supported by the grid. It seems like they might work if the Scrollbar could be given an Id?

Re: Refresh Scrollbar when Grid is refreshed

Posted: Mon Apr 29, 2013 3:33 pm
by Scott Klement
Haha.. you're right that the "e.cd()" function is not supported for you to call directly! And, indeed, we cannot guarantee that it will have the same name in subsequent versions of Profound UI.

But, perhaps it could be given a proper name and made available in the future? I can look into that for you, if you like.

Re: Refresh Scrollbar when Grid is refreshed

Posted: Mon Apr 29, 2013 5:04 pm
by bluttman
It works well for a "ScrollTop" function and would be helpful to have it as a "proper" function ;-)

Ideally it would be nice to be able to "refresh" the scrollbar, setting it back to the top and sizing properly for the amount of data in the grid. Keeping in mind on my particular example I have 2 grids and therefore 2 scrollbars so they would need to be IDed like the grids.

Re: Refresh Scrollbar when Grid is refreshed

Posted: Tue Apr 30, 2013 10:31 am
by Scott Klement
There are times, however, where you want to keep the scrollbar in the same position so the user is on the same page they left off.

I'm thinking we could have a function to reset the position, or a way to set the first RRN viewed on the screen.

Re: Refresh Scrollbar when Grid is refreshed

Posted: Tue Apr 30, 2013 2:51 pm
by bluttman
True.

The option to pass a RRN number could be useful.

Re: Refresh Scrollbar when Grid is refreshed

Posted: Tue Apr 30, 2013 5:59 pm
by Scott Klement
What version of Profound UI are you running? (I need this to figure out what "e.cd()" is, since names like this change each time we re-build the product.)

Re: Refresh Scrollbar when Grid is refreshed

Posted: Thu May 02, 2013 12:18 pm
by bluttman
4.5.3