Search
IEnumerable.addRange Method
See Also
 






Adds a range of elements to the end of the collection.

Namespace: MindFusion.Common.Collections
File: IEnumerable.js

 Syntax

JavaScript  Copy Code

function addRange (range)

 Parameters

range

Array. The range to add.

 Example

The following code uses the addRange method to add an array of TreeNode-s to the root element of a TreeView.

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