View Full Version : [CLOSED] Drag & Drop between a gridpanel and a treepanel questions

Apr 18, 2013, 2:02 AM

I have a TreePanel that supports drag & drop within itself. I am using the RemoteMoveUrl property to fire up an MVC controller method that moves the nodes to the target node on the server side. Everything is fine there.

Now, I want to be able to drag&drop some records from a GridPanel on the same TreePanel. I went through the drag&drop samples including this one: http://examples2.ext.net/#/DragDrop/Grid/Grid_to_Tree/. What I want to do is a bit different than the sample, I want to execute a server action upon dropping files on the tree panel. The action of dropping GridPanel rows on a node won't result in any new nodes in the TreePanel, rather I need to change, on the server side, the parent of those dragged rows to the target node (similar with dropping files into a folders tree).

Is this doable, in the context where I also have the ability to drag nodes within the tree? I am a bit confused about how these drag & drop operations come together and I don't know exactly what events I have to handle.

Also, copy vs move. You now how in some tools, if you press the Ctrl key before you start the drag operation, the Move operation becomes a Copy. Is that supported when I drag&drop nodes within the same TreePanel respectively when I drag&drop rows from a GridPanel to a TreePanel?

Thank you

Apr 18, 2013, 6:16 AM
Hi @bogc,

Is this doable, in the context where I also have the ability to drag nodes within the tree?

I would say it is doable.

In the example you mentioned there is the BeforeDrop event used. You can listen it to call server methods (DirectEvent/DirectMethod).

Re: ctrl + drag

I am afraid there is no a built-in option. Needs to implement manually. Probably, overriding/extending the respective drag&drop classes is the best option.