Reputation: 2934
I've setup a CellList using an AsyncDataProvider that calls a server with a search string.
When my user enters a new search string I want CellList to refresh.
How can I tell my CellList to refresh? Do I call removeDataDisplay() and then addDataDisplay?
Upvotes: 1
Views: 590
Reputation: 121998
You can try.
cellList.setVisibleRangeAndClearData(cellList.getVisibleRange(), true);
Upvotes: 3
Reputation: 895
You can call cellList.setVisibleRangeAndClearData( range, true)
API to trigger the onRangeChange method of the AsyncDataProvider.
Since you are using Cell list, the above mentioned call should happen when the user scrolls to the end of the currently visible list
. And the Range should be -
private Range range = new Range( cellList.getVisibleRange().getStart() + cellList.getVisibleRange().getLength(), cellList.getVisibleRange().getLength() );
cellList.setVisibleRangeAndClearData( range, true);
Upvotes: 0