当前位置:编程学习 > JAVA >>

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

在页面组件完成后开发做动作:
 
 
[java]  
<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)">  
展开第一项:
[java] 
protected function application1_applicationCompleteHandler(event:FlexEvent):void  
            {     
                var item:XML  = this.managerTree.dataProvider[0];     
                this.managerTree.expandChildrenOf(item,true);    
                  
            }  
 
展开所有项:
[java]  
protected function application1_applicationCompleteHandler(event:FlexEvent):void  
{   
for each(var item:XML in this.managerTree.dataProvider)  
this.managerTree.expandChildrenOf(item,true);    
  
}  
 
补充:软件开发 , Java ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,