Results 1 to 8 of 8

Thread: Tree - Node become child

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    12

    Default Tree - Node become child

    Hello all
    I can not find any example of how to drag Tree node to other node so that dropped node become parent of dragged node (see image).
    With other words, Node "Child 2" should become parent of "Child 4" node.
    Here is current code:
    Code:
        var store1 = new Ext.data.TreeStore({
            model: 'Item',
            root: {
                text: 'Root 1',
                expanded: true,
                children: [{
                    text: 'Child 1',
                    leaf: true
                }, {
                    text: 'Child 2',
                    leaf: true
                }, {
                    text: 'Child 3',
                    leaf: true
                }, {
                    text: 'Child 4',
                    leaf: true
                }]
            }
        });
    Thank you for any hint.
    P.S.
    Here is video which was made by someone else describing my problem, too:
    http://vimeo.com/1469876
    As you can see, from left side tree it is possible to drop only on folder My Files (on right tree) but I also need the option where tree node can be dropped on "normal" node, not only on "folder" node.
    Attached Images Attached Images

  2. #2
    Sencha User
    Join Date
    Sep 2012
    Posts
    12

    Default Tree - Node become child

    Hello all
    is there any solution for this?
    Thank you for any idea.
    Last edited by Jasni; 24 Mar 2014 at 5:01 AM. Reason: Still not solved

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Thinking I'm missing something, but doesn't it already work that way?
    https://fiddle.sencha.com/#fiddle/4fu

  4. #4
    Sencha User
    Join Date
    Sep 2012
    Posts
    12

    Default

    Hello
    thank you for your example, but I need this:
    - when I drag "detention" from Simple Tree 1 and drop it into "chemistry" on Simple Tree 2, that "chemistry" become parent of "detention".
    With other words, I need option that every node on Simple Tree 2 can be parent if I drag a node from Simple Tree 1 and drop it into Simple Tree 2.

    Currently, I can drop only above or below of "chemistry" and I need a third option to drop "inside" of "chemistry" so the "chemistry" become a parent of dragged node.
    Thank you
    Attached Images Attached Images

  5. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    12

    Default

    Does anybody have some solution ?
    Thank you.

  6. #6
    Sencha User
    Join Date
    Sep 2012
    Posts
    12

    Default

    Anybody, please?

  7. #7
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    Do not specify leaf: true.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  8. #8
    Sencha User
    Join Date
    Sep 2012
    Posts
    12

    Default

    Thanks a lot!Now, how to remove + sign from node which have no children's?Thanks!

Posting Permissions

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