here is another option:

         public function openTree():void {
          var obj:Object = new Object();
          obj = dirTree.dataProvider.getItemAt(0);
          dirTree.expandItem(obj, true);
        }
#dirTree---tree id.

hq


----- Original Message ----
From: Christophe Herreman <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, April 16, 2007 1:10:59 PM
Subject: Re: [flexcoders] expand entire tree?

Hi Joshua,

try this:

var dp:XML = tree.dataProvider[ 0];
tree.openItems = dp..node;

Note that this code works for a dataprovider with a root node and with 
"node" as the nodenames.

regards,
Christophe

joshua gatcke schreef:
>
> Does anyone know how to expand a tree on initialize? I have tried the 
> following with no avail: 
>
>
> private function setPageListTree( ):void{
> pageListTree. openItems( pageListTree. dataProvider. getItemAt( 1));
> pageListTree. expandItem( pageListTree. dataProvider. children( ), true);
> pageListTree. expandChildrenOf (pageListTree, true);
> }
>
> Thanks in advance, 
>
>
>
> Joshua Gatcke - Director
> *Visua Design Group Inc.*
> Cell:(403) 815-3265
> [EMAIL PROTECTED] ca <mailto:[EMAIL PROTECTED] ca>
>
>
>
>
> 


Reply via email to