Refresh Scrollbar when Grid is refreshed
-
- 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
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?
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?
-
- 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
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.
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.
-
- 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
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!
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!
-
- 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
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?
-
- 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
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.
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.
-
- 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
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.
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.
-
- 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
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.
I'm thinking we could have a function to reset the position, or a way to set the first RRN viewed on the screen.
-
- 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
True.
The option to pass a RRN number could be useful.
The option to pass a RRN number could be useful.
-
- 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
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.)
-
- Profound User
- Posts: 35
- Joined: Mon Feb 20, 2012 6:45 pm
- First Name: Brian
- Last Name: Luttman
- Company Name: BEPCO, Inc.
- Contact:
Who is online
Users browsing this forum: No registered users and 2 guests