FlowingCode / GridHelpers

Several grid recipes for Vaadin 23+ (and 22), ready to use. DOES NOT require extending Grid.
https://addonsv23.flowingcode.com/grid-helpers
Apache License 2.0
12 stars 1 forks source link

Add a helper to clear grids #1

Closed ngonzalezpazFC closed 2 years ago

ngonzalezpazFC commented 2 years ago

Grid doesn't have a method to clear its content. Maybe adding this feature could be helpful. If the grid has in memory data, setItems can be called as: grid.setItems(Collections.<T>emptyList()); And if it configured to fetch items lazy: grid.setItems(DataProvider.fromFilteringCallbacks(query -> Collections.<T>emptyList().stream(), query -> 0));

mlopezFC commented 2 years ago

It doesn't make sense to clear a lazy loaded grid in that way, it should be also made by the first way, and that is just to little code to add a helper.