我使用AsyncDataProvider设置了一个CellList,它使用搜索字符串调用服务器。
当我的用户输入新的搜索字符串时,我希望CellList刷新。
如何告诉我的CellList刷新?我是否调用removeDataDisplay()然后调用addDataDisplay?
答案 0 :(得分:4)
答案 1 :(得分:3)
你可以试试。
cellList.setVisibleRangeAndClearData(cellList.getVisibleRange(), true);
答案 2 :(得分:0)
您可以调用cellList.setVisibleRangeAndClearData( range, true)
API来触发AsyncDataProvider的onRangeChange方法。
由于您使用的是Cell列表,因此上面提到了call should happen when the user scrolls to the end of the currently visible list
。范围应该是 -
private Range range = new Range( cellList.getVisibleRange().getStart() + cellList.getVisibleRange().getLength(), cellList.getVisibleRange().getLength() );
cellList.setVisibleRangeAndClearData( range, true);