|
You need to use node.getProperty(“label”)
not .attributes, this way your code will work regardless of how the
dataProvider was specified. Matt From: First
time creating trees in Flex. Can someone explain how to find the selected tree
node on a tree that has a data model created programmatically? I create
my data model as shown below (example from Flex ActionScript Language Ref 1.5).
The tree is displayed correctly. When I try to use the nodeOpen event on my
Tree control, however, selectedNode is undefined. Event.node.attributes.label
and event.node.attributes.data are also undefined. However, if I use an mx:XML
dataprovider as most tree usage examples do, these attributes are not
undefined. Code
to create model: Tree
Control: <mx:Tree
id="indTree" dataProvider="{treeDP}"
height="100%" change="treeSelected( event );"
Thanks
for any help you can provide, Gary
Ault
|
Title: Get selected tree node for dynamically created tree

