Builds the element IDs the table needs for ARIA references (aria-activedescendant, aria-owns).

All IDs of one table start with the same prefix: ge- + the id of the host element, or ge-t<n> (a running number) if the host has no id. Several tables on one page therefore never clash, and with a host id the IDs stay the same when the table is rebuilt.

Only the focused cell carries an ID (see cell); the other cells have none (performance).

Example

const ids = new AriaIds(AriaIds.createPrefix("orders"));
ids.cell("body", 5, 2); // "ge-orders-body-r5-c2"
ids.rowGroup("header", "center"); // "ge-orders-rg-header-center"
ids.liveRegion(); // "ge-orders-live"

Since

1.1.91

Hierarchy

  • AriaIds

Constructors

Properties

prefix: string

Methods

  • The ID of a cell (set on the focused cell, referenced by aria-activedescendant).

    Parameters

    • area: AreaIdent

      header, body or footer

    • rowIndex: number

      row index in the area

    • columnIndex: number

      model column index (west + center + east)

    Returns string

    e.g. "ge-t1-body-r5-c2"

  • The ID of the row group of the detail rows (master/detail), referenced by aria-owns of the host.

    Returns string

    e.g. "ge-t1-rg-detail"

    Since

    1.1.97

  • The ID of one of the nine row groups (role="rowgroup"), referenced by aria-owns of the host.

    Parameters

    Returns string

    e.g. "ge-t1-rg-body-center"

  • The ID prefix of a table.

    Parameters

    • Optional hostId: string

      the id of the host element (may be empty)

    Returns string

    "ge-" + hostId, or "ge-t" + n with a number that is unique on the page