Results 1 to 5 of 5

Thread: Tree: nodedrop event

  1. #1
    Ext User
    Join Date
    Sep 2008
    Posts
    24
    Vote Rating
    0
      0  

    Default Tree: nodedrop event

    This is probably an easy question and the answer's probably staring me right in the face.. but.. On a nodedrop, how do I glean the previous (source?) parentNode of the node that's being dropped from the dropEvent object.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Vote Rating
    90
      0  

    Default

    Have you tried its parentNode property?

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Vote Rating
    90
      0  

    Default

    No, that will be its new parent. In the beforenodedrop handler, it will still have its old parent.

  4. #4
    Ext User
    Join Date
    Sep 2008
    Posts
    24
    Vote Rating
    0
      0  

    Default

    dropEvent.dropNode.parentNode is returning the NEW (target) parent

  5. #5
    Ext User
    Join Date
    Mar 2010
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Sorry mcahill81, but Animal is right on this one. If you output a dropEvent.dropNode.parentNode within beforeNodeDrop handler and the same within nodeDrop handler, you will get different parent nodes (obviously only if you drag'n'drop to a different parent).

    I actually tried it myself because I am performing some validation in these handlers and needed a way to restore dropNode's original location when validation fails.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •