无法获取 GWT CellTable 的行单击处理程序
我正在尝试为 GWT CellTable (GWT 2.1) 设置行单击处理程序。 stackoverflow 帖子 此处 表明您应该能够获得处理程序的类型使用:
boolean isClick = "click".equals(event.getType())
但是 event.getType()
不返回字符串,因此评估不起作用。 CellPreviewEvent 正在工作,但它触发了很多事件(不仅仅是点击),我很难弄清楚如何只获取点击事件。
有没有人找到解决方案? (或者可以解释我在帖子后面做错了什么)
I'm trying to setup a Row-click handler for the GWT CellTable (GWT 2.1). The stackoverflow post here indicates that you should be able to get the type of handler using:
boolean isClick = "click".equals(event.getType())
But event.getType()
doesn't return a string, so the evaluation isn't working. The CellPreviewEvent is working, but it fires lots of events (not just click), and I'm having a hard time figuring out how to only get the click events..
Has anyone found a solution to this? (Or can explain what I'm doing wrong in following the post)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要获取与 GwtEvent 关联的本机事件:
You need to get the native event associated with the GwtEvent:
使用
NoSelectionModel
并监听SelectionChange
事件。Use a
NoSelectionModel
and listen toSelectionChange
events.我正在使用带有单元格表的检查列。您可以像下面的示例一样处理选择更改事件。
I'm using a check column with a celltable. You can handle selection change event like the sample below.