Row and column numbers for screen readers – computed once per render pass from the table model.

With virtual scrolling only the visible rows and columns are in the DOM, so the table tells screen readers the real size (aria-rowcount, aria-colcount on the grid) and the position of every rendered row and cell (aria-rowindex, aria-colindex):

  • rows are numbered 1-based over header → body → footer; a hidden header/footer (setHeaderVisible(false)) counts 0,
  • the body counts all rows of the model (after the filter; a tree: the displayed nodes),
  • columns count only the shown columns (width > 0): a column hidden with setColumnVisible(…, false) has no aria-colindex, the following columns move up,
  • a body with an unknown row count (getRowCount() < 0) gives aria-rowcount="-1".

Example

// 1 header row, 1000 body rows, 10 columns, column 3 hidden
const info = AriaGridInfo.create(tableModel);
info.rowCount; // 1001
info.colCount; // 9
info.rowIndex("header", 0); // 1
info.rowIndex("body", 0); // 2
info.colIndex(4); // 4 (column 3 is skipped)
info.colIndex(3); // 0 (hidden)

Since

1.1.91

Hierarchy

  • AriaGridInfo

Constructors

  • Parameters

    • headerRowCount: number

      rendered header rows (0 if the header is hidden)

    • bodyRowCount: number

      body rows of the model (negative = unknown)

    • footerRowCount: number

      rendered footer rows (0 if the footer is hidden)

    • colIndexMap: number[]

      per model column its aria-colindex (0 = hidden)

    Returns AriaGridInfo

Properties

bodyRowCount: number

body rows of the model (negative = unknown)

footerRowCount: number

rendered footer rows (0 if the footer is hidden)

headerRowCount: number

rendered header rows (0 if the header is hidden)

Accessors

Methods

  • aria-colindex of a column.

    Parameters

    • columnIndex: number

      model column index (west + center + east)

    Returns number

    the 1-based position among the shown columns, 0 for a hidden or unknown column

  • aria-colspan of a cell that spans columns: the number of shown columns it covers.

    Parameters

    • columnIndex: number

      the first column of the cell

    • colspan: number

      the number of model columns the cell spans

    Returns number

    the number of shown columns (at least 1)

  • aria-rowindex of a row (1-based over header → body → footer).

    Parameters

    • area: AreaIdent

      header, body or footer

    • rowIndex: number

      row index in the area

    Returns number

    the 1-based row number in the whole grid