GWT列排序处理程序,如何获取已选择的列的值
我在 GWT 中有一个单元格表,想要在其上实现来自数据库(条件)的排序功能 为此,我只想知道如何获取已单击进行排序的列的值,
这是我来自 event.getColumn() 的代码
ctJobs.addColumnSortHandler(new ColumnSortEvent.Handler() {
public void onColumnSort(ColumnSortEvent event) {
event.getColumn();
event.getColumn().getValue("what do we need to write here ???");
的形式获取列
,我以对象com.google.gwt.cell.client .ClickableTextCell@188a12e
我想知道列的名称/值 为此,我正在尝试 event.getcolumn().getvalue("??"); 但它的参数是什么,或者有没有其他方法来获取已单击的列的名称。
谢谢
I have a celltable in GWT and want to implement sorting functionality on it , from database(Criteria)
for that i just want to know how to get the value of the column which has been clicked for sorting
here is my code
ctJobs.addColumnSortHandler(new ColumnSortEvent.Handler() {
public void onColumnSort(ColumnSortEvent event) {
event.getColumn();
event.getColumn().getValue("what do we need to write here ???");
from event.getColumn() , i am getting column in the form of object
com.google.gwt.cell.client.ClickableTextCell@188a12e
I want to know the the column's name / value
for that i am trying event.getcolumn().getvalue("??");
but what is the parameter for that, or is there any other way of getting column's name which has been clicked.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的单元格表使用的是
ListDataProvider
还是AsyncDataProvider
?对于
AsyncDataProvider
,排序必须在服务器端完成,因此无需添加ColumnSortHandler
。请参阅 GWT 文档。
要获取单击进行排序的列的名称,请参阅此问题。
Are you using a
ListDataProvider
or anAsyncDataProvider
for your cell table?In case of an
AsyncDataProvider
the sorting must be done on the server side, so there is no need to add aColumnSortHandler
.Please see the GWT docs.
To get the name of the column clicked for sorting see this question.
创建表列时,设置列的dataStoreName。
接下来,在 AsyncDataProvider 中获取单击标题的排序历史记录,如下所示
When creating the table columns, set the dataStoreName of the column.
Next, when in the AsyncDataProvider get the sort history of the clicked headers like the following