insertNode (node, beforeNode)
node. The node to be inserted into the tree.
beforeNode. The node before which the new node is to be inserted.
The insertNode method inserts a node into the tree.
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: