isLast();
The isLast method determines whether the node is the last in its branch.
The method returns true if the node is the last in its branch, else - false.
To execute the example, the page must contain the TreeList component named «treeList» (see Example of Creating the TreeList Component). Determine whether the node with the Africa contents is the last node in its branch:
// Determines whether the node with the Africa contents is the last one in its branch if (treeList.findText("Africa").isLast()) { console.log("Node with the Africa contents is the last one in its branch"); } else { console.log("Node with the Africa contents is not the last one in its branch"); }
The result of checking is displayed to the console:
Node with the Africa contents is the last one in its branch
See also: