-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to scroll a grid (live data, ROD) to top? (After changing or updating ListModel)
fireEvent(ListDataEvent.STRUCTURE_CHANGED, -1, -1)
updates the grid, but scrolling stays on the current position - even if the position is after the last row (when row count gets smaller).
Clients.scrollIntoView(getRows().getFirstChild())
does not work - I think because of ROD
invalidate does not help.
I have figured out, that the whole problem only happens, when ROD is activated for the grid. Without rod everything works as expected. After changing the List Model and notifying ListData Event Listeners the grid will scroll to the first row.
With ROD enabled the scroll position stays where it is. You can sometimes see, that it scrolls to the first row for a moment and then goes to the preserved scroll position: It seems that there is some code on client side, which preserves the scroll position in ROD Mode. I will have a look at the sources. Maybe I will understand what happens and, with a bit of luck, there is a way to control this behaviour.
If there is someone out there, who already knows what happens in ROD Mode, it would be great to get some helping information...
Finally I found solution. Tell the Client to scroll up:
for a grid with id mytestgrid:
Clients.evalJavaScript("zk.Widget.$('$mytestgrid').ebody.scrollTop = 0");
simple use invalidate in grid.
Asked: 2013-06-20 10:44:11 +0800
Seen: 45 times
Last updated: Jul 12 '13
composite component help [closed]
EL in a forEach @command not working?
Different template for each grid row
Cardlayout animation is broken
Grid RowRender slow using 6.5.1 and sizable=true
setVisible(false), component will load or not
Decimalbox and doublebox value rounded on iPad
history management with page status