HELP!! onDragDrop getting triggered twice, and I cannot find a way to stop it!
I have set up a onDragDrop event, which when triggered gets triggered twice, once by the item being dropped on, and once by the container for it, which is a dropzone. How can I stop the event from bubbling. I believe that's the term for what's occuring. I tried doing Event.stopPropagation(); but that didn't seem to do anything.
Last edited by Nam; 20 Sep 2007 at 12:56 PM.
Reason: Changing title to something more descriptive
I have noticed that the order of the events assignments dictates when the event is triggered. If I set the ddtarget area, then set the drag element, when the ddtarget is initialized after the drag element, the ddtarget is the last event to bubble.
But, if I initialize the drag element, then initialize the ddtarget area, the ddtarget is the last bubbling item.
1) Open example site, click on the + icon in the center panel toolbar to add a column.
2) Drag one of the boxes into the new column.
3) Drag another box into the new column.
4) Drag the second box over the first box, and release drag.
At this point, since the events bubble, the last event to bubble is the ddtarget which causes the box to always be appended to the column as the last element. If you attempt this with the initial two columns which are loaded by default, since they are initialized before the ddproxy, the last event triggered is the item being dropped on. Which is the functionality I want. Drag a box over another box, then the box is placed before the item being dropped on.
In my understanding there is two ways to solve this problem. One, I could somehow disable the event from bubbling through to the ddtarget. Second, I could somehow change the weight of DD event triggers, so that I could have the events returned in a particular order. Problem is, I have no idea on how to do this with ExtJS.. Please, can someone give me an idea, hint, or something which can help me resolve this problem?
Nothing is fricken working. I'm getting really fustrated with this, and I am not getting any responses. Please, someone with knowledge of DragDrop functionality take a look at this, and help a fellow developer out. PLEASE!! and Thank You!!