getIndex()
returns the index of the item by its id
getIndex(id: Id): number;
Parameters:
id: string
- the id of the item
Returns:
The index of the item.
Example
const index = component.data.getIndex("1"); // -> returns 0
Related sample: Data. Get index