hilla
hilla copied to clipboard
Grid with unknown size
Hello,
Grid lazy loading works well based on How to load paged data (lazy-load) in Vaadin.
As I don't know the total size (I'd need to iterate all items) of the data set:
- I've tried to don't pass the optional parameter size of the GridDataProviderCallback
- the data are fetched from the endpoint but the grid is empty.
Any idea what I might be doing wrong?
AFAIK this works well in Flow via LazyDataView.
Thanks in advance Roman
For now I use
async itemsProvider(
params: GridDataProviderParams<any>,
callback: GridDataProviderCallback<any>
) {
...
let totalSize = params.page * params.pageSize + items.length + 1; //+1 -> workaround, produces extra empty row
callback(items, totalSize);
}
so when I scroll down, next batch is loaded.