Tree manipulation, PLEASE HELP.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Tree manipulation, PLEASE HELP.

Kristjan Cočev
Say I have two trees:

var firstTree = new qx.ui.tree.Tree("First");
var secondTree = new qx.ui.tree.Tree("Second");

//now I add some folders to both
firstTree.add(new new qx.ui.tree.TreeFolder("one");
firstTree.add(new qx.ui.tree.TreeFolder("two");
//nest the second
var folder1 = new qx.ui.tree.TreeFolder("oneInSecond");
var folder2 = new qx.ui.tree.TreeFolder("twoInSecond-Nested");
folder2.add(new qx.ui.tree.TreeFolder("threeInSecond-Nested");
secondTree.add(folder1);

How can I add the e.g. folder2 ("twoInSecond-Nested") under the  
firstTree's child "one",
if I have only the reference variables: firstTree and secondTree  
available??

Please help!

Best regards, Kris


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Tree manipulation, PLEASE HELP.

Petr Kobalíček
Hi Kristjan,

look at tree methods hasContent() and getItems().

getItems() will always return itself as first children! I mean you must find node you want and insert item using add() or similar functions.

I hope that this way is correct ;-)

2008/7/7 Kristjan Cočev <[hidden email]>:
Say I have two trees:

var firstTree = new qx.ui.tree.Tree("First");
var secondTree = new qx.ui.tree.Tree("Second");

//now I add some folders to both
firstTree.add(new new qx.ui.tree.TreeFolder("one");
firstTree.add(new qx.ui.tree.TreeFolder("two");
//nest the second
var folder1 = new qx.ui.tree.TreeFolder("oneInSecond");
var folder2 = new qx.ui.tree.TreeFolder("twoInSecond-Nested");
folder2.add(new qx.ui.tree.TreeFolder("threeInSecond-Nested");
secondTree.add(folder1);

How can I add the e.g. folder2 ("twoInSecond-Nested") under the
firstTree's child "one",
if I have only the reference variables: firstTree and secondTree
available??

Please help!

Best regards, Kris


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel