getFocusIndex

returns the index of the item in focus

number getFocusIndex();

Deprecated

To get the index of a DataView 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 = dataview.getFocus();
var index = dataview.data.getIndex(id);

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

dataview.getFocus();

Returns

numberthe index of the item in focus

Example

var index = dataview.getFocusIndex(); // -> 1

Back to top