I am using the Vaadin Grid
to display data from my backend.
At the moment I am using setItem
s with a custom pagination.
This way, I can tell the Grid
, which data it should display, but the drawback is, that I can’t navigate past the page using the keyboard.
Therefore, I wanted to switch to using the DataProvider
but the DataProvider
seems to be made for offset
pagination, while I need seek pagination.
The issues I am facing are the following:
- I don’t know the size of the dataset.
TheDataProvider
needs the total size of the dataset, for a givenQuery
but in my case, the total size is unknown.
I tryed to work around this issue, by setting the size topageSize + 1
to be able to navigate one item further, but the count is only queried once, so I can’t increase it’s size with each page.
Then I tryed to set it toInteger.MAX_VALUE
, but this results in a lot of empty rows at the end of the dataset. - I can’t use the
offset
.
Since I would like to use seek paginagion, I can’t use theoffset
provided by theQuery
.
Instead, I would like to get thecurrentObject
, thedirection
and thelimit
. - The
offset
is wrong, when the order or filter changes.
When the order or filter changes, I try to keep the focus on the selected item.
Since the order and/or filter changed, the item is not at the same position in the dataset anymore.
That means, theoffset
I get from theQuery
does not represent the objects position in the dataset anymore.
Did anyone try to use the DataProvider
for seek pagination?
Are there any plans on supporting that in future?