Checks if the given element is present in the collection.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
JavaScript Copy Code |
---|
function contains (item) |
Type: Object
Object. The object to check for.
Type: Boolean
Boolean. True if the element is found, otherwise false.
The following code checks if a TreeNode element called "div" is contained within the collection of items of a TreeView instance.
JavaScript Copy Code |
---|
// create a tree node that will be a root in our hierarchy var span = new ui.TreeNode("span"); var elements = [span, div, p]; if (root.items.contains(div)) |