如何获取 flash builder 中 mx.dataGrid 中选定行的单元格值
我以为我可以使用...
studentID = myDataGid.selectedItem.studentID
不想为我工作。跟踪调试中的表达式,它返回“XMLList (@11e55e8d1)”。
数据源是 XMLListCollection。跟踪表达式 myDataGid.selectedItem 我可以看到 StudentID 节点并且它有一个值。
我做错了什么?
我发现从 Flex 4.5 开始,Adobe 建议我们使用 Spark.components.DataGrid 类作为 mx:dataGrid 的替代品,我对 mx:dataGrid 完全不熟悉,也不知道从哪里开始学习。我有这个 mx:dataGrid 所有设置和其他工作,并且不想学习新东西。
谢谢,
约翰
I thought I could use...
studentID = myDataGid.selectedItem.studentID
Does not want to work for me. Tracing the expression in debug it is returning "XMLList (@11e55e8d1)".
The datasource is an XMLListCollection. tracing the expression myDataGid.selectedItem I can see the studentID node and it has a value.
What am I doing wrong?
I see that starting with Flex 4.5, Adobe recommends that we use the spark.components.DataGrid class as an alternative to the mx:dataGrid which I am not at all familiar with or where to start to learn. I have this mx:dataGrid all setup and otherwise working and would prefer not to have to learn something new.
Thanks,
John
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来不错 - 它返回您需要的 xml 数据部分。我认为这是获取数据的问题:
上面将 XMLList 作为字符串返回,但您可能需要将其作为数字获取(取决于不可见的 XML 结构)。
That looks ok - it returns the part of the xml data that you need. I presume it's a matter of getting the data:
The above returns the XMLList as a string, but you might need to get that as a Number (depending on the structure of your XML which isn't visible).