GWT CellTable columnsorting

前端 未结 2 1918
一向
一向 2021-01-06 23:55

I am trying to sort on a column in GWT using their ListDataProvider Sorting example as a reference

http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellTable.h

2条回答
  •  不知归路
    2021-01-07 00:33

    My experience says sort handler (i.e. ListHandler) is sensitive to the List, which ListDataProvider has, when you are creating it.

    So I recommend not to delete or set new List for ListDataProvider (of course I think it should has at least an empty (not null) list when you are creating).

    Just use ListDataProvider.getList() and do your jobs on it.

    For example for removing all current rows and setting new data, just call ListDataProvider.getList().clear() and then ListDataProvider.getList().addAll(yourNewData); do not call setList() or the sorting becomes not working.

提交回复
热议问题