Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    20
    Vote Rating
    0
    countdown is on a distinguished road

      0  

    Default Problem with removing a component that is Ext.dd.DropTarget

    Problem with removing a component that is Ext.dd.DropTarget


    Hi
    In my application I have many components where I create an Ext.dd.DropTarget on their elements!
    Some components may be later removed (e.g. a tab window closed). I have noticed that in the Ext.dd.DragDropMgr the 'ids' array which contains all elements in a ddGroup those components aren't removed!!!
    The grid and tree with automatic DD are removed but not manually added components!

    What would be the best way of emptying the Ext.dd.DragDopMgr ids array ? Is this a bug and should Ext manually handle this or am I maybe using the DropTarget wrong?

    I hope it is understandable what the issue is, if not any questions are welcome!
    thanks for help!

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It's a bug in your code.

    If you create an Ext.dd.DropTarget, then you are responsible for destroying it when no longer needed.

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    20
    Vote Rating
    0
    countdown is on a distinguished road

      0  

    Default


    thanks Animal! was affraid this was the issue!
    dropTarget.destroy() on beforeDestroy component does the trick!
    Only question remains how to automate this process, since there is no point in keeping a dropTarget if the target is gone...or is it?

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Right. Didn't you say you had the solution? A beforedestroy listener on the Component?

  5. #5
    Sencha User
    Join Date
    Dec 2009
    Posts
    20
    Vote Rating
    0
    countdown is on a distinguished road

      0  

    Default


    yes, but I manually added a listener to the component.
    I was thinking more in the lines of overriding dropTarget constructor and adding there a before destroy listener to the linked component (have to figure out how to override constructors though ). But that would probably mess up some extended classes like TreeDropZone, so I'll probably drop that idea!
    Thanks again for help.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Override a constructor === a subclass.

    But the DropTarget has no idea whether the Element that it is operating on is part of a Component.

    You have it upside down. The Component's initialization must take care of setting things up so that it tears itself down correctly.

    You might need overrides, or a subclass on the Component class.

  7. #7
    Ext JS Premium Member Juanito's Avatar
    Join Date
    Apr 2007
    Location
    San Diego->Boston->Brazil
    Posts
    159
    Vote Rating
    4
    Juanito is on a distinguished road

      0  

    Default


    Beware that the beforedestroy event and the beforeDestroy event do not guarantee that the component is going to get destroyed. If any of the listeners return false, the destroy process is stopped and you will have a half destroyed component, in your case, your drag and drop won't work.

    It's not very common to stop the destroy process, but it's still possible.

    The way I handle it is by overriding the destroy method, at that point, you're guaranteed that the component will be destroyed. You should do your destruction and the call the parent destroy method.

Similar Threads

  1. Problem with DropTarget
    By TAG in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 21 Aug 2009, 8:57 AM
  2. Multiple DropTarget groups on component
    By ionut.rachita in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 30 Jul 2009, 5:26 AM
  3. Keeping listeners when removing a component
    By thething in forum Ext 2.x: Help & Discussion
    Replies: 12
    Last Post: 11 Mar 2009, 4:18 AM
  4. Removing and adding components to dom component
    By jahman in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 1 Dec 2008, 5:41 AM
  5. [SOLVED] Removing component from container
    By kgmoney in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 7 Aug 2008, 4:16 PM

Thread Participants: 2