博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Using the itemDoubleClick event to open nodes in a Flex Tree control
阅读量:7121 次
发布时间:2019-06-28

本文共 1673 字,大约阅读时间需要 5 分钟。

  The following example shows how you can use the itemDoubleClick event to open the selected Tree node in Flex.

<?
xml version="1.0" encoding="utf-8"
?>
<!--
 http://blog.flexexamples.com/2007/11/29/using-the-itemdoubleclick-event-to-open-nodes-in-a-flex-tree-control/ 
-->
<
mx:Application 
xmlns:mx
="http://www.adobe.com/2006/mxml"
        layout
="horizontal"
        verticalAlign
="middle"
        backgroundColor
="white"
        creationComplete
="init();"
>
    
<
mx:Script
>
        
<![CDATA[
            import mx.events.ListEvent;
            private function tree_itemDoubleClick(evt:ListEvent):void {
                var node:XML = tree.selectedItem as XML;
                var isOpen:Boolean = tree.isItemOpen(node);
                tree.expandItem(node, !isOpen);
            }
        
]]>
    
</
mx:Script
>
    
<
mx:XMLListCollection 
id
="xmlListColl"
>
        
<
mx:source
>
            
<
mx:XMLList
>
                
<
node 
label
="One"
>
                    
<
node 
label
="One.1"
>
                        
<
node 
label
="One.1.1"
>
                            
<
node 
label
="One.1.1.1"
>
                                
<
node 
label
="One.1.1.1.1"
 
/>
                            
</
node
>
                        
</
node
>
                    
</
node
>
                    
<
node 
label
="One.2"
 
/>
                    
<
node 
label
="One.3"
 
/>
                
</
node
>
                
<
node 
label
="Two"
>
                    
<
node 
label
="Two.1"
 
/>
                    
<
node 
label
="Two.2"
 
/>
                    
<
node 
label
="Two.3"
 
/>
                
</
node
>
                
<
node 
label
="Three"
 
/>
            
</
mx:XMLList
>
        
</
mx:source
>
    
</
mx:XMLListCollection
>
    
<
mx:ApplicationControlBar 
dock
="true"
>
        
<
mx:CheckBox 
id
="checkBox"
                label
="doubleClickEnabled:"
                labelPlacement
="left"
                selected
="true"
 
/>
    
</
mx:ApplicationControlBar
>
    
<
mx:Tree 
id
="tree"
            dataProvider
="{xmlListColl}"
            labelField
="@label"
            width
="250"
            rowCount
="6"
            doubleClickEnabled
="{checkBox.selected}"
            itemDoubleClick
="tree_itemDoubleClick(event);"
            showScrollTips
="true"
 
/>
</
mx:Application
>
    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/01/10/1033994.html
,如需转载请自行联系原作者
你可能感兴趣的文章
我的友情链接
查看>>
vCenter Server5.1安装(1)
查看>>
好用的usb加密软件,rohos mini drive。
查看>>
js表单验证
查看>>
jquery中formSerialize问题
查看>>
python学习记录-基础 2014/02/28
查看>>
html5播放mp4视频代码
查看>>
java ID生成策略个人总结
查看>>
关于当前的一点记忆or牢骚
查看>>
两个开放平台内部组件开放
查看>>
五 手游开发神器 cocos2d-x editor 之贴图(TexturePacker)
查看>>
Fastreport.Net用户手册:表达式显示
查看>>
flex与js交互浅析
查看>>
JAVA定时器
查看>>
chrome插件之如何抓取有防盗系统网站内容
查看>>
新建和增加SWAP分区
查看>>
我的友情链接
查看>>
插入排序(JAVA)
查看>>
SpringBoot+MyBatis事务管理
查看>>
tornado
查看>>