getFocusIndex

returns the index of an item in focus

number getFocusIndex();

Deprecated

To get the index of a List item in focus you can get the id of an item using the getFocus() method and pass this id as a parameter of the getIndex method of Data Collection:

var id = list.getFocus();
var index = list.data.getIndex(id);

But we recommend you to use the getFocus() method instead:

list.getFocus();

Returns

numberthe index of an item in focus

Example

var index = list.getFocusIndex(); // -> 6

Back to top