2 Replies Latest reply on Feb 27, 2011 11:09 PM by Jason_Engr

    Drag and Drop question

    Jason_Engr

      I am having a slight problem with drag and drop.  I have nested drag and drop containers. I can either drag and drop on the parent, or I drag and drop on one of its children.  If I drag over the parent which can accept the item and then over a child that cannot accept the item I am dragging, when I move back over the parent it still shows as not accepted.  When I go over the child dragExit is never dispatched, and upon moving back over the parent a new dragEnter event does not get dispatched. Any suggestions?

       

      Thanks,

       

      Jason

        • 1. Re: Drag and Drop question
          Sree_D Level 2

          I think after you have dragEnter initially at child level and is not accepted. The event is bubbled to till the parent. Can you try stopping the propogation at the child level so that the enter event does not traverse and same should be done at parent lvel also. Let me know if it works.

          • 2. Re: Drag and Drop question
            Jason_Engr Level 1

            Definitely appreciate the response, but stopping propagation on the event didn't work. I think the problem lies somewhere with this code on the child dragEnter handler:

             

                if (acceptable)
                 DragManager.acceptDragDrop(event.currentTarget as IUIComponent);
                } else {
                 DragManager.showFeedback(DragManager.NONE);
                }

             

             

            The DragManager has already accepted it on the parent.  So if I don't show feedback none then it works as expected.  Currently if an element is draggable onto the child but not the parent it works as expected, going over the child it shows accepted then when I drag back over the parent it shows not accepted as expected.  I want to make the converse work, where if the parent can accept it, then I drag over the child it shows that it can't be added there.