9/7/2010 2:33:18 AM
Title:
Tree
Hi,
I have a tree(like parent nodes, children nodes). I want to insert a new parent node, whenever i insert a new node, the focus is on new node. How to do that?
How to set the focus on inserting a new node?
9/7/2010 9:25:55 AM
to set focus for a particular node of tree component in flex you can use the following code . Use creationComplete event and set the index to be selected.
//
private function initTree():void {
// expand the root
XMLTree1.expandItem(myXMLCollection.getItemAt(0), true);
// select the index of the item to show selected
XMLTree1.selectedIndex = 2;
}
<mx:Tree id="XMLTree" width="150" height="170" creationComplete="initTree();">