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.
}
You can get the ADG from the
AdvancedDataGridEventand then you can try to cast itsdataProviderto anIHierarchicalCollectionView. If that worked you can use it to get the children of the opend node.