MindFusion.Charting for JavaScript Programmer's Guide
IEnumerable.indexOfItem Method
See Also
Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: None Language Filter: C# Language Filter: Visual Basic Language Filter: Java Language Filter: JavaScript Language Filter: C++ Language Filter: XAML

C#
Visual Basic
Java
JavaScript
C++
XAML

Gets the index of a given object in a collection.

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

## Syntax

JavaScript Copy Code
function indexOfItem (obj, [fromIndex])

### Parameters

obj

  Type: Object
  Object. The object to look for.

fromIndex
  Optional.

  Type: Number
  Number. The starting index to search from.

### Return Value

Type: Number
Number. The index of the object, or -1 if the object is not present in the collection.

## Example

The 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); function listSelectionChanged(sender, args) { if( args.oldItems.contains(item1)) { } }

## See Also

IEnumerable Members
IEnumerable Class
MindFusion.Common.Collections Namespace