addAt Method

Adds a TREENODE at the given Integer index.

Syntax

object.addAt(index, node)

Parameters

index Required. Index at which to add the TREENODE.
node Required. The TREENODE to add.

Return Value

No return value.

Remarks

When applied to the TREENODE element, the node is a child node of the TREENODE. When applied to the TREEVIEW element, the node is a root node.

Examples

This example creates a TREENODE root element. It assumes that the treeview has an id value of treeview_one.

var myNode = treeview_one.createTreeNode();

myNode.setAttribute("text", "My New Root Node");

treeview_one.addAt(0, myNode);

You can also place the value of the index into a string, as in the following example.

var myNode = treeview_one.createTreeNode();

myNode.setAttribute("text", "My New Root Node");

treeview_one.addAt("0", myNode);

Applies To

TREEVIEW, TREENODE

See Also

About the TreeView WebControl, TreeView, add, addTo, createTreeNode