Datagrid 在某一列选择了行 as3
我需要通过AS3获取所选行中某一列的值,我该怎么做?
当我尝试 grid.SelectedItem.text
时,它一直返回 null...
感谢您的帮助!我需要能够按名称引用该列,在本例中为“ID”。
编辑:这需要举办活动吗?难道不应该有一个内置的方法吗?你会这么想...
I need to get the value of a certain column in the selected row via AS3, how can I do this?
It keeps returning null when I try grid.SelectedItem.text
...
Thanks for the help! I need to be able to reference the column by name, in this case "ID".
EDIT: Does this require an event or something? Shouldn't there be a method for this built in? You'd think so...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你能说得更具体一点吗?
您可以使用 selectedItem.yourProperty 从 DataGrid 中获取所需的所有数据。
你能发布一个片段来让事情变得清楚吗?
按名称引用列非常简单:
数据位于 DataGrid 的 dataProvider 中,列则用于其他目的。
假设您已将 ID 属性添加到 DataGrid:
如果您已为 CHANGE 事件,你应该能够获取你需要的数据
通过 selectedItem:
HTH,
乔治
Can you be a bit more specific ?
You can get get all the data you need from the DataGrid using the selectedItem.yourProperty.
Can you post a snippet that might make thing clear ?
Referencing a column by name is pretty easy:
The data is in the DataGrid's dataProvider, the column is there for other purposes.
Say you have an ID property added to the DataGrid:
If you have setup a handler for the CHANGE event, you should be able to get the data you need
through the selectedItem:
HTH,
George