复选框单元格和可选单元格表格行 [英] Checkbox Cell and Selectable Cell Table rows

查看:130
本文介绍了复选框单元格和可选单元格表格行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与SingleSelectionModel关联的GWT 2.4 DataGrid。网格中的一列是CheckboxCell,但不用于选择,而是为行的基础项目类型设置布尔字段值。我的问题是,当我点击复选框时,首先选中该行,然后我必须再次单击以设置/取消选中该复选框。我希望单击复选框的选择行,而单击复选框内的 仅设置/取消选中复选框。任何人都可以指导我如何做到这一点的正确方向。我一直回到onBrowserEvent,但我不知道该怎么做。

有几种方法可以做,这取决于你想要做什么。这里有两个想法:


I have a GWT 2.4 DataGrid associated with a SingleSelectionModel. One of the columns in the grid is a CheckboxCell, but it is not used for selection, but to set a boolean field value for the underlying item type of the row. My problem is that when I click on the checkbox, the row is selected first, then I have to click a second time to set/unset the checkbox. I would prefer that clicking outside of the checkbox does row selection, while clicking inside of the checkbox only sets/unsets the checkbox. Can anyone point me in the right direction on how to do this. I keep coming back to onBrowserEvent, but I'm not sure what to try.

解决方案

There's a couple of approaches you can do, depending on what exactly you want to do it. Here are the two ideas that come to mind:

这篇关于复选框单元格和可选单元格表格行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆