Nitobi User Forums Forum Index

    (RSS)
Nitobi User Forums
Nitobi Support Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to add a nodes on the tree view

 
Post new topic   Reply to topic    Nitobi User Forums Forum Index -> Tree
View previous topic :: View next topic  
Author Message
fross1



Joined: 10 Aug 2007
Posts: 1

PostPosted: Fri Aug 10, 2007 9:06 pm    Post subject: How to add a nodes on the tree view Reply with quote

Hello,
I would like to know how can i add a node on the client side.
I see the add method, how use it.

like this :

$('myTree').add(who, who);

1.If i use the add method, the node will be created ?
2.Can I edit the content like the grid ?

Thanks in advance.
Back to top
View user's profile Send private message
jake



Joined: 18 Oct 2007
Posts: 6

PostPosted: Sat Oct 20, 2007 5:44 am    Post subject: Reply with quote

You must create the node before you add it to the tree.
Code:

var tree = nitobi.getComponent('ID of your tree');
var newNode = new nitobi.tree.Node();
newNode.setLabel("my new node");

// Assuming you want to make it a root node:
tree.getChildren().add(newNode);

// Assuming you want to make it the child of the root node's 3rd child:
tree.getChildren().get(0).getChildren().get(2).getChildren().add(newNode);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Nitobi User Forums Forum Index -> Tree All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group