Search
IEnumerable.clone Method
See Also
 






Creates a copy of the collection.

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

 Syntax

JavaScript  Copy Code

function clone ()

 Return Value

IEnumerable. A copy of this collection.

 Example

The following code copies the collection of items of a TreeNode, which is of type IEnumerable:

JavaScript  Copy Code

var treeView = new ui.TreeView(document.getElementById("treeView"));
treeView.width = treeView.height = ui.Unit.percentage(100);
treeView.theme = "standard";
treeView.loadOnDemand = true;

// 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);

var copyCollection = root.items.clone();

 See Also