Results 1 to 2 of 2

Thread: Tree Panel: Add Child(folder) then add grandchild(leaf) to that child folder

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    55
    Answers
    4
    Vote Rating
    0
      0  

    Default Answered: Tree Panel: Add Child(folder) then add grandchild(leaf) to that child folder

    Hi,
    I'm working with a tree panel that has the drag & drop plugin configured in it's view.

    When a user clicks a button, I've successfully added a new, "non-leaf" type node to my root node using appendChild({}). Next, I have another button that adds a new "leaf"type node. Now I have two different types of node, both children of the root node.

    What I'd like is for the new "leaf"type node to be created with in the last "non-leaf" type node that's been added. Also, I would like to constrict the "non-leaf" type nodes to only be able to be dropped into the 1st children (folders). In other words, I don't want leaf nodes to be able to be dropped to the root node. I want to allow leaf drops to the other non-leaf nodes

    Is this achievable?

  2. You should keep track of the last non-leaf node created so that when you create a leaf it will go to that tracked non-leaf node.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    You should keep track of the last non-leaf node created so that when you create a leaf it will go to that tracked non-leaf node.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

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