Refresh Scrollbar when Grid is refreshed

Use this board to ask questions or have discussions with other Rich Displays users.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Refresh Scrollbar when Grid is refreshed

Post 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?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Refresh Scrollbar when Grid is refreshed

Post 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.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Refresh Scrollbar when Grid is refreshed

Post 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!
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Refresh Scrollbar when Grid is refreshed

Post 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?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Refresh Scrollbar when Grid is refreshed

Post 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.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Refresh Scrollbar when Grid is refreshed

Post 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.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Refresh Scrollbar when Grid is refreshed

Post 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.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Refresh Scrollbar when Grid is refreshed

Post by bluttman »

True.

The option to pass a RRN number could be useful.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Refresh Scrollbar when Grid is refreshed

Post 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.)
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Refresh Scrollbar when Grid is refreshed

Post by bluttman »

4.5.3
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests