Gets the index of a given object in a collection.
Namespace: MindFusion.Common.Collections
Assembly: IEnumerable.js
SyntaxJavaScript
Copy Code
|
|---|
function indexOfItem (obj, [fromIndex]) |
Object. The object to look for.
Number. The starting index to search from.
Number. The index of the object, or -1 if the object is not present in the collection.
ExampleThe following code checks if the old items of a ListView instance, which have changed contain an item called item1:
JavaScript
Copy Code
|
|---|
listView.selectionChanged.addEventListener(listSelectionChanged);
if( args.oldItems.contains(item1)) |
See Also