Hi Flexors,

I came up with the following solution:


public function expandAllTreeNodes(node:Object){
  tree.setIsOpen(node,true);
  var nodeChildren:XMLList = node.children();
  var nodeChildrenLength:Number = nodeChildren.length();
                 
  for  (var i:Number = 0; i< nodeChildrenLength; i++) {
        if (nodeChildren.children()) {
                expandAllTreeNodes(nodeChildren[i]);
        }
  }
}

-------  Below is the Button that calls the above function --------

<mx:Button label="Open Tree" id="openTreeBt"
click="expandAllTreeNodes(tree.getNodeDisplayedAt(0))" />

--- Note: ----------------------------------------------------------

The tree's id=tree and its dataProvider is a resultset from CF.

--------------------------------------------------------------------

Hope the above is helpful for anyone who might be needing this
functionlity from the tree ...

Cheers.

Tim


--- In [email protected], "sufibaba" <[EMAIL PROTECTED]> wrote:
>
> Hi Flexors,
> 
> I have a tree with a dataProvider= xmlresultset.  
> 
> I would like to have an openAllNodes() function and CloseAllNodes()
> function for this tree.
> 
> From the material that is in the flex2 beta documentation regarding
> manipulating the tree nodes, it seems like there are a few ways to do
> this. Via traversing the XML model or traversing the tree.  Has anyone
> converted Flex1.5 code for OpenAllNodes and CloseAllNodes to flex2.
> 
> Cheers,
> 
> T
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to