Hello everyone,
setting the selection inside the grid via "activeItem" works nice, no issues.
BUT: what, if the item being selected is not in the currently visible area of the grid? How to "scroll" the grid to the correct position so that the activeItem becomes visible?
Regards,
Michael
Unfortunately, looks like it's a missing feature in the public API.
As a temporary solution, you can use the grid鈥檚 internal method directly: grid.$.scroller.scrollToIndex(i);. Warning: private API, can change anytime (although it鈥檚 unlikely to happen before grid v4.0 release).
Thx!
+1 for this
Is there a possibility to use the private API when the grid is sorted? When using the API on a sorted grid, it scrolls to to original position of the item not the current one based on the sorting.
This doesn't work with vaadin-grid 5.0.0-pre.5: $0.$.scroller.scrollToIndex is undefined.
Is there any plan to make this a public/established API? Seems like this would resolve the issue (and could change as-necessary).
This does work: grid._scrollToIndex(0) where 0 is the first row (following the headers).
Will be fixed by #1169
Most helpful comment
This doesn't work with
vaadin-grid 5.0.0-pre.5:$0.$.scroller.scrollToIndex is undefined.Is there any plan to make this a public/established API? Seems like this would resolve the issue (and could change as-necessary).
This does work:
grid._scrollToIndex(0)where 0 is the first row (following the headers).