itemDoubleClick事件
示例:
代码:
<?
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
>
相关文章
- 为什么双击打开py文件时窗口瞬间关闭了?
- vs2010 双击打开文件的时候报错后关闭
- 为什么双击打开py文件时窗口瞬间关闭了?
- 在Windows 10 操作系统打开Windows Mobile 设备中心,要么双击无反应,要么正在启动后过会就关闭了
- 盘符双击不能打开;任务管理器,注册表,msconfig闪一下自动关闭--问题和解决办法
- 为什么桌面上的图标,只要双击打开就显示遇到问题,自动关闭
- QT QTreewidget节点打开关闭状态图标
- 在Windows 10 操作系统打开Windows Mobile 设备中心,要么双击无反应,要么正在启动后过会就关闭了
- 双击打开关闭树节点.
- vs2010 双击打开文件的时候报错后关闭