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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,026
    Answers
    3976
    Vote Rating
    1367
      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
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •