获取 AdvancedDataGrid 中扩展节点下的项目
有没有办法获取扩展 ADG 树节点下的项目?
给定示例树节点:
- Atlantic
Celtics
Nets
Knicks
Sixers
Raptors
+ Central
+ SouthEast
+ SouthWest
+ NorthWest
+ Pacific
我计划捕获 ADG 的 itemOpen 事件中的数据。
private function myADG_ItemOpen(event:AdvancedDataGridEvent) :void
{
// What codes do I put here to get the following teams:
// Celtics, Nets, Knicks, Sixers, Raptors
}
更新: 我成功地完成了一些代码,这些代码以某种方式为我提供了一个包含团队的对象:
var ihd:IHierarchicalData = IHierarchicalCollectionView(myADG.dataProvider).source;
if(ihd.hasChildren(evt.item))
{
var objGetChildren:Object = ihd.getChildren(evt.item);
var dataString:String = ObjectUtil.toString(objGetChildren);
// From here, I am able to parse the dataString to an array, where I am able to get the team name.
}
Is there a way to get the items which are under an expanded ADG tree node?
Given the sample tree node:
- Atlantic
Celtics
Nets
Knicks
Sixers
Raptors
+ Central
+ SouthEast
+ SouthWest
+ NorthWest
+ Pacific
I am planning to capture the data in the ADG's itemOpen event.
private function myADG_ItemOpen(event:AdvancedDataGridEvent) :void
{
// What codes do I put here to get the following teams:
// Celtics, Nets, Knicks, Sixers, Raptors
}
Update:
I managed to pull off some codes that somehow provides me an object containing the teams:
var ihd:IHierarchicalData = IHierarchicalCollectionView(myADG.dataProvider).source;
if(ihd.hasChildren(evt.item))
{
var objGetChildren:Object = ihd.getChildren(evt.item);
var dataString:String = ObjectUtil.toString(objGetChildren);
// From here, I am able to parse the dataString to an array, where I am able to get the team name.
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以从
AdvancedDataGridEvent
获取 ADG,然后尝试将其dataProvider
转换为IHierarchicalCollectionView
。如果有效,您可以使用它来获取打开的节点的子节点。You can get the ADG from the
AdvancedDataGridEvent
and then you can try to cast itsdataProvider
to anIHierarchicalCollectionView
. If that worked you can use it to get the children of the opend node.