Ad

How Do You Make Drag And Drop Always Copy (never Remove) In A Flex 4 Spark List?

- 1 answer

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.

Ad

Answer

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.

Ad
source: stackoverflow.com
Ad