Dragging and dropping items in a Flex Tree control

The following example shows you how you can reorder nodes in a Flex Tree control by setting the  dragEnabled dropEnabled , and  dragMoveEnabled  properties
<? xml version="1.0" encoding="utf-8" ?>
<!--  http://blog.flexexamples.com/2007/11/29/dragging-and-dropping-items-in-a-flex-tree-control/  -->
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white" >

    
< mx:XML  id ="xmlDP" >
        
< root >
            
< para  label ="Paragraph 1"  isBranch ="true" >
                
< node  label ="Lorem ipsum dolor sit amet, consectetuer adipiscing elit."   />
                
< node  label ="Cras porttitor nunc a pede."   />
                
< node  label ="Nulla ac magna non risus accumsan egestas."   />
                
< node  label ="Aenean pretium porta felis."   />
                
< node  label ="Sed massa."   />
            
</ para >
            
< para  label ="Paragraph 2"  isBranch ="true" >
                
< node  label ="Pellentesque pretium eros id odio tincidunt lobortis."   />
                
< node  label ="Praesent vitae dolor eget nisl adipiscing pretium."   />
                
< node  label ="Fusce nonummy dignissim risus."   />
                
< node  label ="Nunc sodales, lectus vitae nonummy cursus, augue lectus auctor orci, vel aliquet enim neque vel eros."   />
                
< node  label ="Donec laoreet euismod libero."   />
                
< node  label ="Etiam ut lectus."   />
            
</ para >
            
< para  label ="Paragraph 3"  isBranch ="true" >
                
< node  label ="Maecenas ut nibh eu diam viverra suscipit."   />
                
< node  label ="Pellentesque auctor, turpis vel lobortis suscipit, neque tortor tristique nibh, venenatis suscipit nisl nisl eget magna."   />
                
< node  label ="Donec interdum."   />
                
< node  label ="Praesent diam."   />
            
</ para >
            
< para  label ="Paragraph 4"  isBranch ="true" >
                
< node  label ="Proin nulla."   />
                
< node  label ="Morbi tincidunt, sapien in sollicitudin venenatis, nibh tortor pretium ante, non pharetra urna dolor et libero."   />
                
< node  label ="In malesuada risus at neque."   />
            
</ para >
            
< para  label ="Paragraph 5"  isBranch ="true"   />
        
</ root >
    
</ mx:XML >

    
< mx:Tree  id ="tree"
            dataProvider
="{xmlDP}"
            labelField
="@label"
            showRoot
="false"
            verticalScrollPolicy
="on"
            alternatingItemColors
="[#FFFFFF,#EEEEEE]"
            showScrollTips
="true"
            dragEnabled
="true"
            dropEnabled
="true"
            dragMoveEnabled
="true"
            width
="300"
            rowCount
="6"   />

</ mx:Application >



    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/01/11/1034817.html ,如需转载请自行联系原作者


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值