如何获取 flash builder 中 mx.dataGrid 中选定行的单元格值

发布于 2025-01-07 02:51:46 字数 423 浏览 3 评论 0原文

我以为我可以使用...

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戒ㄋ 2025-01-14 02:51:46

看起来不错 - 它返回您需要的 xml 数据部分。我认为这是获取数据的问题:

studentID = myDataGid.selectedItem.studentID.toXMLString();

上面将 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:

studentID = myDataGid.selectedItem.studentID.toXMLString();

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文