I did this but it had some problems with the width being set. I seems to grow too fast, but to add a node I did this:
  var added = node.add( <parameters> );
  added.invokeEvent('create');
  node.collapse();
  node.addChild( added );
  node.expand();
 
This was the only way I could get the new node to show up.
 
Jon
-----Original Message-----
From: Richard Bennett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 11:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [Dynapi-Help] Dynamic Tree Building

If you want to add nodes dynamically you'll have to experiment, you can call 
node1.add(blah)
after the tree is built, and then
myTree.repaint()
or maybe node1.repaint()
 
but you'll need to add more code to get it to work properly.
 
Richard.
----- Original Message -----
Sent: Thursday, March 15, 2001 6:44 PM
Subject: [Dynapi-Help] Dynamic Tree Building

I am new to this Dynamic Layer API. Please bear with me if my questions are slightly dumb.
Is there a way I can dynamically add Tree Nodes to the TreeView  ( I am using the Richard's Fast Tree http://www.resass.f2s.com/dynapi/Richard_Examples/ri_fast_tree_view.htm )
 
For eg. I would like to add a Node to the Tree Based on the text the user entered and when they click a button.
I understand that it can be done if I refresh the whole page. But, I do not want to refresh the whole page.
Basically, I am trying to build a dynamic tree based on what the user searches for.
 
Any ides?
 
TIA for any help.
 
Dinesh.

Reply via email to