View Full Version : Drag & Drop: Swap dd elements on drag over?

Stefan Isak
26 Dec 2010, 10:26 AM

reading all over the drag & drop tutorials and examples, I am still not able to implement the following thing.

If I drag an element over a drop zone, that already holds an element, the elements should switch places.
Right now, I have no idea how to do that. To have an example, we can use this one: http://www.sencha.com/blog/2009/09/13/5-steps-drag-and-drop-with-ext-js/

Lets say I have only one garage, so I can have no more than one car in repair. If I drag another car to 'Vehicles In Repair', the current car in repair should move back to available cars.

Any suggestions?

Thanks in advance.

29 Dec 2010, 10:54 AM
Hi Stefan,

I wrote that example and blog post. We'd have to extend the functionality to detect the drag-over events.

I did this with grid to grid drag and drop for my book: http://extjsinaction.com/examples/chapter14/dnd_grid_to_grid.html