Flex GroupingCollection:循环子级
我正在使用 GroupingCollection 来绑定我的高级数据网格。我使用 groupingcollection 按日期对数据进行分组。
现在我需要通过代码选择数据网格中的数据。有谁知道如何做到这一点?我需要循环访问 adg 的数据提供程序并选择与选择标准相匹配的项目。
请指教
谢谢:)
I am using a GroupingCollection to bind my advanceddatagrid. I have used groupingcollection to group the data by date.
Now I need to select the data in the datagrid through the code. Does anyone have any idea as to how to do this? I need to loop through the adg's dataprovider and select the item that matches the criteria for the selection.
Please advise
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,根据问题的解释方式,此代码将找到与所选分组年份匹配的项目。我向
mx:AdvancedDataGrid
添加了一个click=findStuff(event)
,如下所示:请注意,首先我从 AdvancedDataGrid dataProvider 获取 GroupingCollection,然后获取项目来自分组集合。这些可以合并为一个步骤,但这种方式对于示例来说更具可读性。由于不确切知道您要查找的数据,我只是从数据
item
中获取name
字段,但您没有理由无法获取整个item< /代码>。
希望这对您来说是朝着正确方向迈出的一步。
Okay, depending on how the question in interpreted, this code will find the items that match the grouping year that is selected. I added a
click=findStuff(event)
to themx:AdvancedDataGrid
, as shown here:Note that first I get the GroupingCollection from the AdvancedDataGrid dataProvider, then I get the items from the GroupingCollection. These could be combined into one step, but this way is more readable for the example. Not knowing exactly what data you're looking for I just grab the
name
field from the dataitem
but there's no reason you couldn't grab the wholeitem
.Hopefully this is a step in the right direction for you.
source
属性应包含数据的平面表示。The
source
property should contain the flat representation of the data.