Flex tree默许展开第一项和所有项

Flex tree默认展开第一项和所有项

在页面组件完成后开发做动作:


<s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:view="com.greencloud.view.*"
			   xmlns:mx="library://ns.adobe.com/flex/mx"  height="100%" width="100%" creationComplete="application1_applicationCompleteHandler(event)">
展开第一项:
protected function application1_applicationCompleteHandler(event:FlexEvent):void
			{	
				var item:XML  = this.managerTree.dataProvider[0];  	
				this.managerTree.expandChildrenOf(item,true);  
				
			}

展开所有项:

protected function application1_applicationCompleteHandler(event:FlexEvent):void
{ 
for each(var item:XML in this.managerTree.dataProvider)
this.managerTree.expandChildrenOf(item,true);  

}