All docs
V23.2
24.1
23.2
23.1
22.2
22.1
21.2
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2.
19.1
The page you are viewing does not exist in version 19.1.
18.2
The page you are viewing does not exist in version 18.2.
18.1
The page you are viewing does not exist in version 18.1.
17.2
The page you are viewing does not exist in version 17.2.

jQuery DataGrid - Column and Row Indexes

You can use the following indexes in methods and callback functions:

  • Initial Column Index (or Column Index)
    Equals the column's index in the columns array.

  • Visible Column Index
    Depends on the column's current location in the DataGrid and changes dynamically when columns are reordered or data is grouped. Use the getVisibleColumnIndex(id) method to get this index.

    DevExtreme HTML5 JavaScript DataGrid Visible Column Index

    This index is not equal to the index set in the column.visibleIndex property. The latter is used to reorder columns.

  • Row Index
    Equals a row's order among rendered rows. This index starts from 0 and increases by 1 per row (includes group and detail rows). Starts from the first row in the visible viewport.

    DevExtreme HTML5 JavaScript DataGrid Row Index

    To get the row index, use the getRowIndexByKey method or rowIndex field in callback functions like onRowClick, onCellClick, etc.

    NOTE
    Rendered rows can be outside the viewport; for example, if scrolling is virtual or infinite or row rendering mode is virtual. You cannot get the row index in such cases.
  • Focused Row Index
    A zero-based index that starts from the first row in the scrolling area.

    To get the focused row index, call the option method with focusedRowIndex as the argument.

    NOTE
    If scrolling is standard, viewport and scrolling area are coincided. In this case, a regular row index and a focused row index have the same value.