TreeNodes.insertNode

Syntax

insertNode (node, beforeNode)

Parameters

node. The node to be inserted into the tree.

beforeNode. The node before which the new node is to be inserted.

Description

The insertNode method inserts a node into the tree.

Example

To execute this example, the page must contain the TreeList component named treeList (see Example of Creating the TreeList Component). Add a new node before the first tree node:

treeList.getNodes().insertNode(new PP.Ui.TreeNode(

{

    Columns: ["1", "2", "3"],

    Text: "New Node"

}), treeList.getNodes().getItem(0))

After executing the example a node named New Node is inserted before the first node of the tree.

See also:

TreeNodes