getIndex()
returns the index of the item by its id
getIndex(id: string | number): number;
Parameters:
id: string | number
- 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