PDA

View Full Version : Detecting Multiple drop targets - Drag and Drop Question



nyrsimon
23 Nov 2011, 12:27 PM
Hi all,

OK so I am deep in the bowels of drag'n'drop land. It is a soccer app where I drag around players over other players, players on the bench etc

So given the size of the screen it is possible to drag one player over TWO other players - at least it touches two other players and hence generates two drop events. I would like to be able to detect it is over two players.

I know I could walk through all my 'droppable' items and look for the x-drop-hover class, but I was hoping there was a more elegant way.

I have considered changing the validDropMode from intersect to contains but that is difficult as each item is the same size, so dragging it in is tough (although I did see the 'tolerance' ref in the source code for future use...hmmmm).

I have also considered using a timer that would set so that if another drop event occurred within say 250ms then it would be discarded, but seems like a hack....

Anyway I was hoping for some Holiday Magic....any ideas folks???

Simon

mitchellsimoens
23 Nov 2011, 1:19 PM
I would probably start with looking for the hover class items and see where that takes you.

maria.parra
24 Nov 2011, 7:51 AM
Hi all,
I have several items Ext.util.Draggable on my page that work perfectly.
My question is how do I get any of them may be dropped over another
draggable element?
Thx a lot