apache-flexdrag-and-dropflex4

How do you make drag and drop always copy (never remove) in a Flex 4 Spark List?


Using the built in drag and drop features in Flex I can drag an item from one list and drop it into another list. But this removes the item from the first list. In my case I need to keep the items in the original list. So I need to always create a copy behavior for my users.


Solution

  • There is a property called, "dragMoveEnabled" that was set to "true".

    From the documentation:

    The description of this property is, "A flag that indicates whether items can be moved instead of just copied from the control as part of a drag-and-drop operation. If true, and the dragEnabled property is true, items can be moved. Often the data provider cannot or should not have items removed from it, so a MOVE operation should not be allowed during drag-and-drop."

    When set to false or removed I'm getting the behavior that I want which is Copy always without having to also press the CTRL key for it to work.