本文介绍了GWT CellTable列排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用它们的ListDataProvider Sorting示例作为参考在GWT中对列进行排序



问题是我可以看到我的表列数据正在排序(通过使用调试器),但表永远不会刷新。查看上述链接中的示例,它们不会显式刷新显示。我在这里错过了什么?



谢谢。

解决方案

说,排序处理程序(即ListHandler)是敏感的列表,ListDataProvider有,当您创建它。



所以我建议不要删除或设置新List ListDataProvider (当然我认为它在创建时应该至少有一个空的(非空)列表)。



只需使用 ListDataProvider.getList( )并在其上执行任务。



例如,要删除所有当前行并设置新数据,只需调用 ListDataProvider.getList()。clear() ListDataProvider.getList()。addAll(yourNewData);
不要调用 setList()或者排序不起作用。


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.html#columnSorting

The problem is I can see my table column data is getting sorted (by using the debugger) but the table never gets refreshed. Looking at the example in the above link they do not explicitly refresh the display. Am I missing something here?

Thanks.

解决方案

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.

这篇关于GWT CellTable列排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 23:14