List dropEnabled="true" ,dragMoveEnabled="true" : List Drag Drop « Components « Flex






List dropEnabled="true" ,dragMoveEnabled="true"

List dropEnabled=
           

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp();">
    <mx:Script>
    
    import mx.managers.DragManager;
    import mx.events.DragEvent;
    import mx.collections.ArrayCollection;
    private function initApp():void {
    firstList.dataProvider = new ArrayCollection([
            {label:"First", data:"1"},
            {label:"Second", data:"2"},
            {label:"Third", data:"3"},
            {label:"Fourth", data:"4"}
        ]);
        secondList.dataProvider = new ArrayCollection([]);
    }
    private function dragOverHandler(event:DragEvent):void {
        event.preventDefault();
        event.currentTarget.showDropFeedback(event);
        if (event.dragSource.hasFormat("items")){
            if (event.ctrlKey) {
                DragManager.showFeedback(DragManager.COPY);
                return;
            }
        }
        DragManager.showFeedback(DragManager.NONE);
    }
    private function dragDropHandler(event:DragEvent):void {
        dragExitHandler(event);
    }
    private function dragExitHandler(event:DragEvent):void {
       

    }
  
    </mx:Script>
    <mx:HBox id="myHB">
    <mx:List id="firstList" dragEnabled="true"/>
    <mx:List id="secondList"
        dropEnabled="true"
        dragMoveEnabled="true"
        dragOver="dragOverHandler(event);"
        dragDrop="dragExitHandler(event);"
        dragExit="dragExitHandler(event);"/>
    </mx:HBox>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Dragging and dropping among three List componentsDragging and dropping among three List components
2.Drag-and-drop lets you move items from one List control to anotherDrag-and-drop lets you move items from one List control to another
3.Drag drop to copy between two ListsDrag drop to copy between two Lists
4.Drag And Drop List SampleDrag And Drop List Sample
5.Drag and Drop Within a ListDrag and Drop Within a List
6.Drag and Drop Between ListsDrag and Drop Between Lists
7.Drag-and-drop to move items from one MX List control to anotherDrag-and-drop to move items from one MX List control to another
8.Drag and drop to item in List To another ListDrag and drop to item in List To another List
9.List To List Drag and DropList To List Drag and Drop