Search
TreeNode Constructor
See Also
 






Initializes a new instance of the TreeNode class.

Namespace: MindFusion.Common.UI
File: TreeNode.js

 Syntax

JavaScript  Copy Code

function TreeNode ([title])

 Parameters

title
Optional.

String. The title of the new TreeNode.

 Example

The following code creates a new TreeNode called root and then adds several other TreeNode-s to it:

JavaScript  Copy Code

// create a tree node that will be a root in our hierarchy
var root = new ui.TreeNode("body");
root.expanded = true;

var span = new ui.TreeNode("span");
var div = new ui.TreeNode("div");
var p = new ui.TreeNode("p");

var elements = [span, div, p];
root.items.addRange(elements);

 See Also