Grid initially loads more than page size number of items when configured to lazy load
See original GitHub issueDescription of the bug / feature
I’m looking to implement lazy load to a grid with a custom backend data provider. I’m trying to load ~5 rows initially (total item count is 33 from the backend)
grid.setPageSize(5);
grid.setDataProvider(dataProvider);
However it seems like the data provider would just return all 33 (default limit is 50 according to what I read from the docs?) because the grid has determined that there’s a scroll bar so it could load up to 50 items? This comment on stackoverflow describes what I think I’m experiencing
Versions:
- Vaadin / Flow version: 14.4.10
- Java version: 11
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Grid with lazy loading: very high number of calls into the data ...
To reduce the number of requests, the logic always fetches at least one page of items at the same time. The default page...
Read more >Configuring Lazy Loading for WordPress with W3 Total Cache
It is implemented by the browser rather than a plugin. You can and likely should still use Lazy Loading through the W3 Total...
Read more >Vaadin Grid Lazy Loading Issue - Stack Overflow
With this page size my experience is that Grid is fetching 50 - 100 items at the time in cases like yours (~25-30...
Read more >JavaScript Grid: Infinite Row Model
Infinite scrolling allows the grid to lazy-load rows from the server depending on what the scroll position is of the grid.
Read more >Make Webpages Load Faster with Lazy Loading - Infinum
Lazy loading is a technique that defers the loading of non-critical resources during the page load time. Instead, these non-critical resources ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @fionnachan,
I’ve been told that there are plans to change this behavior, so you will be able to change the minimum rows that the grid needs to load.
I have opened a new issue in the grid component repository (https://github.com/vaadin/vaadin-grid/issues/2166), so you can follow up it from there.
Thanks and best regards
Thanks for the reply @miguelatvaadin. In my case, because I have several component columns, preloading 25 rows is enough to slow down the page load. Is there any way to get around this to reduce the number of preloaded items?