在高级数据网格中选择一行时触发函数事件
以下代码似乎仅在高级数据网格上有 editable="true"
时才有效。但我不希望它是可编辑的。有人对这个问题有任何想法或经验吗?
文档没有说任何关于它需要可编辑的事情,我也不明白为什么它应该是可编辑的。
http://docs.huihoo.com/flex/4/mx /events/DataGridEvent.html#ITEM_FOCUS_IN
a_data_list.addEventListener(AdvancedDataGridEvent.ITEM_FOCUS_IN, clickedRow);
public function clickedRow(event:AdvancedDataGridEvent):void
{
trace("datagrid line was clicked");
}
The Following code seems to only be working when i have editable="true"
on the Advanced Data Grid. But I don't want it it be editable. Anyone have any idea or experience with this issue?
The docs don't say anything about it needing to be editable, and i dont see why it should need to be.
http://docs.huihoo.com/flex/4/mx/events/DataGridEvent.html#ITEM_FOCUS_IN
a_data_list.addEventListener(AdvancedDataGridEvent.ITEM_FOCUS_IN, clickedRow);
public function clickedRow(event:AdvancedDataGridEvent):void
{
trace("datagrid line was clicked");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想知道何时选择/取消选择行,则需要侦听“更改”(ListEvent.CHANGE) 事件。
You need to listen to the "change" (ListEvent.CHANGE) event if you want to know when rows are selected/deselected.
实际上,抱歉克里斯托夫,该问题的正确解决方案是使用
ListEvent.ITEM_CLICK
因为例如,如果突出显示的项目已经突出显示,它将不会触发该函数,因为它不会“更改”完美运行的内容对于这个问题,虽然是项目点击。但感谢您为我指明了正确的方向
Actually, sorry christophe, the proper solution to the issue is using
ListEvent.ITEM_CLICK
Because for example if the highlighted item is already highlighted it will not trigger the function because it does not "change" what does work perfectly for this issue though is item click. But thanks for pointing me in the right direction