User Guide
Tree.addTreeNodeAt() 1287
Parameters
index The zero-based index position (among the child nodes) at which the node should be
added.
label A string that contains the name of the node to add.
data An object of any type that is associated with the node. This parameter is optional.
child Any XMLNode object.
Returns
The added XML node.
Description
Method; adds a node at the specified location in the tree. The node is constructed either from
the information supplied in the
label and data parameters (Usage 1), or from the prebuilt
XMLNode object (Usage 2). Adding a preexisting node removes the node from its previous
location.
Calling this method refreshes the view.
Example
The following example creates two Tree components with a node for each one: 1st Local
Folders
and 2nd Local Folders, respectively. It uses the first usage of addTreeNodeAt() to
add a new node,
Inbox, to the first Tree. It then uses the second usage of addTreeNodeAt()
to add the 1st node ((getTreeNodeAt(0)) from the second Tree to the first Tree.
You must first add the component to the document library by dragging a Tree component to
the Stage and then deleting it; then add the following code to Frame 1.
TIP
First try this example without the two addTreeNodeAt() statements at the end; then try
the full example.