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));
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.
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));