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,如需转载请自行联系原作者

Using the itemDoubleClick event to open nodes in a Flex Tree control相关推荐

  1. Elastic Nodes Example 翻译及学习整理

    文章目录 Elastic Nodes Example 翻译及学习整理 题记: 简介: Node Class Definition Edge Class Definition GraphWidget C ...

  2. WebKit DOM Event (一)

    DOM Event 规范 DOM Event 主要定义了三类接口: EventTarget, 所有DOM节点和XMLHttpRequest 都实现EventTarget接口 class EventTa ...

  3. What is event bubbling and capturing?

    What is event bubbling and capturing? 答案1 Event bubbling and capturing are two ways of event propaga ...

  4. [Swift]LeetCode1110. 删点成林 | Delete Nodes And Return Forest

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ ➤微信公众号:山青咏芝(shanqingyongzhi) ➤博客园地址:山青咏芝(https://www.cnblog ...

  5. G6实现标签拖动连线画流程图

    需求描述 列出所有的task标签,拖动task标签在一旁画流程图,打包task的任务名及id和任务的执行流程以json的格式发给后端. 技术栈 G6,vue,h5自带的draggable实现拖动.也稍 ...

  6. 关系型数据库是如何运作的

    一说到关系型数据库,我总感觉缺了点什么.如果你尝试透过"关系型数据库是如何运作的"的关键词句来进行搜索,其搜索结果是少量的而且内容是简短的.难道说是由于它已经太老旧而已经不再流行吗 ...

  7. 如果有人问你关系数据库的工作原理,叫他看这篇文章How does a relational database work

    When it comes to relational databases, I can't help thinking that something is missing. They're used ...

  8. How does a relational database work

    How does a relational database work NOSQL跟SQL一样,在内存中都是用hash table,都是key-value 只不多nosql几乎无锁,无事务,速度更快, ...

  9. 转载:js跨域问题小结

    本文来自:http://www.kuqin.com/webpagedesign/20090422/47458.html javascript出于安全方面的考虑,是不允许跨域调用其他页面的对象的.但在安 ...

最新文章

  1. css层叠样式表(一)
  2. axios的this指向_vue使用axios中 this 指向问题
  3. ContentType大全
  4. stm32串口学习(二)
  5. vs 服务容器中已存在服务_敏捷基础设施和公共基础服务
  6. nyoj 21 三个水杯 BFS
  7. jquery获取java对象的属性_jQuery - 获得内容和属性
  8. 禁止和开启组策略的批处理
  9. .NET/C# 使用Stopwatch测量运行时间
  10. Facebook Cache Token Issue
  11. Leetcode-Implement strStr()-Python
  12. matlab程序是什么格式,科学网—Matlab中的P代码文件 - 杨笔锋的博文
  13. 性能测试,CPU使用率CPU负载率理解
  14. 在word中给方框打勾
  15. 为什么面试完,总是让你回去等通知?
  16. iOS多线程的初步研究(三)-- NSRunLoop
  17. Windows7下按装使用vagrant踩坑总结及Vagrant常见镜像简单配置
  18. 日本某地(我猜应该是在米花町)发生了一件谋杀案,警察通过排查确定杀人凶手必为4个嫌疑犯的一个。
  19. 自考计算机英语难度,自考本科商务英语专业真的难吗
  20. Android 8.0以上系统应用如何保活

热门文章

  1. 加密芯片——摘要算法特点与应用注意事项
  2. 谷歌EfficientNet缩放模型,PyTorch实现出炉,登上GitHub热榜丨Demo可用
  3. 日常视频一秒变游戏,人物可以随意操控:全靠Facebook的实时算法
  4. 揭秘2018图灵奖评选:Jeff Dean李开复和Lecun写信推荐Hinton
  5. 黑进iPhone让手机崩溃重启,只需15行代码:iOS漏洞你可知?
  6. Jupyter Notebook的三大短板,都被这个新工具补齐了
  7. 又一例两块硬盘离线的数据恢复成功案例
  8. mysql与oracle语法对比(实用)
  9. JavaSE基础:泛型
  10. 浅谈Android数据库DBFlow