TreeNode.getVisualPosition

Syntax

getVisualPosition();

Description

The getVisualPosition method returns a number of the node position in the list of visible elements.

Example

To execute the example, the page must contain the TreeList  component named treeList (see Example of Creating the TreeList Component). Get position number in the list of the node visible elements with the Africa contents:

// Get the node with the Africa contents
var nodeAfrica = treeList.findText("Africa");
//Get position number of the node with the Africa contents in the list of visible elements
console.log("Position number of the node with the Africa contents in the list of visible elements: " + nodeAfrica.getVisualPosition());

As a result, position number of the node with the Africa contents in the list of visible elements is displayed to the console:

Position number of the node with the Africa contents in the list of visible elements: 1

See also:

TreeNode