PDA

View Full Version : Tree - Node become child



Jasni
22 Mar 2014, 11:17 PM
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:


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.

Jasni
23 Mar 2014, 4:12 AM
Hello all
is there any solution for this?
Thank you for any idea.

Gary Schlosberg
24 Mar 2014, 4:43 PM
Thinking I'm missing something, but doesn't it already work that way?
https://fiddle.sencha.com/#fiddle/4fu

Jasni
24 Mar 2014, 10:37 PM
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

Jasni
26 Mar 2014, 10:58 PM
Does anybody have some solution ?
Thank you.

Jasni
2 Apr 2014, 9:41 PM
Anybody, please?

evant
2 Apr 2014, 9:43 PM
Do not specify leaf: true.

Jasni
2 Apr 2014, 9:59 PM
Thanks a lot!Now, how to remove + sign from node which have no children's?Thanks!