TreeNode.getLevel

Syntax

getLevel();

Description

The getLevel method returns the level number where the node is in the tree.

Example

To execute the example, the page must contain the TreeList  component named «treeList» (see Example of Creating the TreeList Component). Get the level number where the node with the Africa contents is:

// Get the level number where the node with the Africa contents is
console.log("Level number where the node with the Africa contents is: " + treeList.findText("Africa").getLevel());

Level number where the node with the Africa contents is: 1

See also:

TreeNode