Hi,
I have a lazy backend provider. I would like to change my view and go back to this view with the same scroll position.
In the grid, there is scrollTo (index of the item) but I don’t know the index of the item. (and on which index I should scroll)
I’ve seen this post (and the link in github): https://vaadin.com/forum/#!/thread/15758435/16018364
But I don’t have a solution for my problem.
Is it possible to get the current position of the grid ? (I don’t see anything in java perhaps there is something with javascript).
Here a part of “my solution” (in javascript) :
To scroll to a position, I can call this function:
private void scrollToPosition(int position) {
JavaScript.getCurrent().execute("document.querySelector('div.v-grid-scroller-vertical').scrollTop = "+position+";");
}
But I don’t know how to get the current position if the grid scrollbar in Java.
To get the position in javascript, I’ve got this function
position = document.querySelector('div.v-grid-scroller-vertical').scrollTop
[/code]How can I get the return value of this function ?
If i understand correctly, I can't get return value from this call [code]
JavaScript.getCurrent().execute
Thanks,