As with all data-oriented components, you rarely work directly with the
component UI.  Instead, you read and manipulate the underlying
dataProvider.

 

All of the functions you note are available in the Collection
APIs(ArrayCollection, XMLListCollection).  Using XML, you have all of
the functions except for removeNode, but for this you use "delete" as
you have tried.

 

This is the correct way to remove nodes.  Delete can be a bit tricky.
Use temporary vars and toXMLString() to ensure you have built the
correct expression.  Then use that expression (not the variable!) with
the delete operator.  I have not had much success using delete with
XMLList and always ensure I am deleteing an XML node.

 

No, there is no unique identifier automatically added to the
dataProvider for the tree.  You must do this yourself if you need it.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of qau_yasir
Sent: Friday, March 28, 2008 2:03 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Does Tree Control have RemoveNode Method?

 

Hi All!
I am have some odd experience with Flex Tree Control. 
I am new to the Flex Environment and working with three control.
I am unable to find some basic functions for Three control Or I am
unable to find them.
1. tree.lenth (Total number of nodes in the tree) 
2. tree.Level (parent child level)
3. tree.RemoveNode() [Extreamly required help if you know some thing
about this I tried to remove node but I am unable to remove the node
of the tree. I use the following code
public function RemoveNode():void { 
var node:XMLList = XMLList(targetTree.selectedItem); 
delete children[0];
}
]

Further selected index of the treeItem changes when the node is
expended and collapsed. Is there any unique identifier for each element?

With Best regards
YM

 

Reply via email to