views:

637

answers:

1

I have a flex project that is made of up several custom components that are mostly based on VBox with Lists of some form or fashion ranging from Tree to AdvancedDataGrid. My main view consists of two custom components which one contains a Tree and other an AdvancedDataGrid.

Using the standard built-in d-n-d in those components, I'm not able to perform d-n-d. So I implemented d-n-d using DragManager and the necessary events (mouseDown, dragEnter, and dragDrop) on those components and that works. However, this approach seems to complicate the other events such as double click and right click actions.

Is there a solution to have native d-n-d with this type of approach?

LeftSide.mxml:

<VBOX>
<Tree/>
</VBOX>

RightSide.mxml:

<VBOX>
<AdvancedDataGrid/>
</VBOX>

main.mxml:

<Application>
<HBOX>
<LeftSide/>
<RightSide/>
</HBOX>
</Application>
A: 

I don't think so.... But what I did a long time ago was only start the drag if the user is holding down the mouse and has held it down for a period of time or moved it a certian distance. I can't remember the specifics, but I'll try to dig out how I did it soon.

Aethex
Sorry, I've long replaced the old dragging method with a custom List control. Would creating a DraggableTreeControl that implements dragging be a viable solution?
Aethex
It might...would I also have to create a DraggableAdvancedDataGrid (or whatever) for other end or just the drag initiator? Also, is there anything special that has to go into the dragDrop event to correct see where in the drop List that the item has been dropped?
Los
See this website:http://www.adobe.com/devnet/flex/quickstart/adding_drag_and_drop/You probably know most of it, but it might be useful. Also try looking at the source of the List control - that has drag/drop support built-in.As for the DraggableAdvancedDataGrid, probably, but it depends on the various facilities that AdvancedDataGrid already has.
Aethex