I am creating tree structure using advanceddatagrid. The dataprovider is grouping collection whose source is arraycollection. This grouping collection is grouping the fields as specified and I am getting the right tree structure.
I have this type of tree structure
Client
Fund
Account
Whenever user clicks on any of these node there is click handler which is as follows:
private function clickhandler(event:Event){
var item:VO=event.currentTarget.selectedItem as VO
Alert(item.ID);
}
Where VO is a bean class whose fields are
ID
Name
When I click on Account node I am getting the right alert value(according to above function) but when I click on fund or client I am not getting value in alert. It says error as Type error:#1009 cannot access the property
So here when I click on leaf node I am getting the data source value which are associated to that node but when I am clicking non leaf node I am not getting the data source values like (as in above function VO.ID and VO.Name). How to get it solved?
Second question: Also I want to know that on which level user has clicked in the tree that is level 1(client) or level 2(fund) or level 3(account).