Hierarchy

Constructors

Properties

Methods

addAndRenderCellDiv adjustAfterScrolling adjustArea adjustBody adjustColumnsToRowParent adjustContainersAndRows adjustDetailLayerBounds adjustDraggingColumn adjustHoverColumns adjustHoverRows adjustRowNumberColumnWidth afterRenderPass applyCellAria applyCssClasses applyRowAria checkForScrollPosSaving clearSelection clientXToHostX debounce disposeRendering drawBigCell findRowOfImportantRowspanCell getArea getAreaAndSideIdentByAttr getAreaChild getAriaGridInfo getAvailableColumnWidth getBodyCellAtHostPoint getBodyCellRectInHost getBodyContentHeight getBodyRowIndexAtY getBodyRowLayout getBodyRowTop getBodyViewport getCheckboxAriaLabel getColumnAriaLabel getColumnLeftInHost getColumnWidths getContentScrollLeft getContentScrollRangeY getDisplayedRowCount getDomService getFirstDataColumnIndex getFirstFullVisibleRowIndex getFirstVisibleRowIndex getInCellEditorCell getLastFullVisibleRowIndex getLastVisibleRowIndex getNumberByAttr getRowHeights getScrollerRangeY getScrollerToContentRatioY getStringByAttr getTreeArrowColumnIndex getViewportScrollLeft hasBodyRowExtras hideDraggingColumn hideHover hideHoverColumn hideHoverRow initHostAria initRenderEditor invalidateAggregates invalidateRowLayout isColumnResizable isEditing isRtl isScrollHeightCapped measureRowNumberText onOverlayChanged onWheel recalcColumnWidths removeHostAria renderContentOfDraggingColumn renderContentOfDraggingColumnForArea repaint repaintHard rerenderCalculatedCells rerenderCellContent rerenderDerivedFooterCells rerenderGroupRowCells resetEditorRenderer resetSizeOfWrapperDiv restoreHostAriaAttribute setBodyRowExtra setEditorDraft setHostAriaAttribute setRawValue setViewportScrollLeft snapToDevicePixel storeColumnWidths updateCells updateOverlay

Constructors

Properties

areaBodyCenter: DivScope
areaBodyCenterGeo: GeoData = ...
areaBodyEast: DivScope
areaBodyEastGeo: GeoData = ...
areaBodyWest: DivScope
areaBodyWestGeo: GeoData = ...
areaFooterCenter: DivScope
areaFooterEast: DivScope
areaFooterWest: DivScope
areaHeaderCenter: DivScope
areaHeaderEast: DivScope
areaHeaderWest: DivScope
areaHeightsOfRenderPass?: {
    body: undefined | number;
    footer: undefined | number;
    header: undefined | number;
}

Area heights read once at the start of adjustAfterScrolling() (before the DOM is modified).

Type declaration

  • body: undefined | number
  • footer: undefined | number
  • header: undefined | number
ariaIds: AriaIds

The IDs this table uses for ARIA references (prefix from the host id).

Since

1.1.91

ariaTexts: AriaTextsIf

Texts for screen readers (English defaults + tableOptions.ariaTexts).

Since

1.1.91

batchEditService?: BatchEditService

Batch edit of this table (pending values, shown in the cells) – created by TableScope.

Since

1.1.96

borderFixedEast: HTMLDivElement
borderFixedWest: HTMLDivElement
borderFooterTop: HTMLDivElement
borderHeaderBottom: HTMLDivElement
cellEditorService?: CellEditorService

Excel-style editing of this table (the editor above the cell) – created by TableScope with tableOptions.editing.

Since

1.1.99

cleanupFunctions: {
    body: Function[];
    footer: Function[];
    header: Function[];
} = ...

Type declaration

  • body: Function[]
  • footer: Function[]
  • header: Function[]
colAndRowspanModels: AreaObjectMapType<ColAndRowspanModel> = ...
contentDiv: HTMLDivElement
contentScrollTop: number = 0

Content pixels scrolled out at the top, i.e. the offset that is actually rendered (see adjustBody).

contentWrapperDiv: HTMLDivElement
debounceTimeout?: null | Timeout

The resolved writing direction of the table (TableOptionsIf.direction; "auto" is decided when the table is built).

Since

1.1.98

displayedRowCount: number = 0
dragging: boolean = false
draggingColumn: HTMLDivElement
draggingTargetColumnIndex: number = -1
editing: boolean = false
fillHandleService?: FillHandleService

Fill handle of this table – created by TableScope.

Since

1.1.96

firstFullVisibleRowIndex: number = -1
firstVisibleRowIndex: number = -1
getFocusModel?: GetT<FocusModelIf>
getSelectionModel?: GetT<SelectionModelIf>
headerFocus?: [number, number]

The header cell with the keyboard focus (row, column of the cell's origin) – set by the arrow-up key in the first body row, see TableScope. undefined: the focus is in the body (FocusModelIf).

hostElement: HTMLDivElement
hoverColumn: HTMLDivElement
hoverRow: HTMLDivElement
lastFullVisibleRowIndex: number = -1
lastVisibleRowIndex: number = -1
loggingActive: boolean = false
masterDetailService?: MasterDetailService

Master/detail of this table (detail rows below master rows) – created by TableScope with tableOptions.masterDetail.

Since

1.1.97

mouseEvent?: GeMouseEvent
pendingContentScroll?: {
    contentTop: number;
    scrollTop: number;
}

Exact content position requested by scrollToPixel() for a capped scroll height (see TableScope).

Type declaration

  • contentTop: number
  • scrollTop: number
pixelLimitForFullVisible: number = 5
rowDragService?: RowDragService

Row drag of this table (drag handles, pointer and keyboard drag) – created by TableScope.

Since

1.1.95

scrollFactorX: number = 0
scrollFactorY: number = 0
scrollLeft: number = 0
scrollTop: number = 0
scrollViewport: HTMLDivElement
scrollViewportLeft: number = 0
storeScrollPosStateService?: StoreStateScrollPosService

Deprecated

since 1.1.92 – no longer used, see TableStateService.

storedColumnWidths: number[] = []
tableModel: TableModelIf
tableOptions: TableOptionsIf
tableOverlay: TableOverlay

The overlay layer over the body ("Loading…", "No rows to show").

Since

1.1.92

tableSheet?: TableSheet

Cell formulas of this table – created by TableScope with tableOptions.cellFormulas (flat bodies).

Since

1.1.99

tree: boolean = false
maxScrollHeightInPx: number = 8_000_000

Maximum height (px) of the scrollable content wrapper. Taller tables are scrolled proportionally (rendering is based on the scroll factor anyway): browsers clamp element heights (Chrome ~33.5 million px) and GPU rasterization loses precision long before (1px borders disappear and text jitters beyond ~16.7 million px). 8 million px keep sub-pixel precision.

Methods

  • Protected

    Adjusts the layout and positioning of the specified area in the table. This method is used internally and should not be called directly.

    Parameters

    • areaIdent: AreaIdent

      The identifier of the area to adjust (e.g. header, body, footer).

    • Optional yStart: number = 0

      The starting y-position for the layout adjustments.

    Returns void

  • Adjusts the dragging column during a mouse move event.

    Parameters

    • mouseMoveEvent: GeMouseEvent

      The mouse move event.

    • sourceColumnIndex: number

      The index of the source column.

    • firstDraggingRendering: boolean

      Indicates if it's the first rendering of the dragging column.

    Returns void

  • Adjusts the position and size of the hover column based on the mouse move event.

    Parameters

    Returns void

  • Adjusts the position and size of the hover row based on the mouse move event.

    Parameters

    Returns void

  • Fits the width of a leading row number column (RowNumberColumnDef) to its largest number. Cheap on every render pass: only the text of the largest number is compared; it is measured (canvas) only when it changed.

    Returns boolean

    true if the width changed (the containers must be adjusted)

    Since

    1.1.93

  • role, aria-colindex, spans and aria-sort of a cell.

    Parameters

    Returns [number, number]

    rowspan and colspan of the cell (≥ 1)

  • Protected

    Applies CSS classes to an HTML element.

    Parameters

    • ele: HTMLDivElement

      The HTML element to which CSS classes will be applied.

    • cssClasses: {
          [key: string]: boolean;
      } = {}

      An object containing CSS class names as keys and boolean values indicating whether to apply or remove the class.

      • [key: string]: boolean

    Returns void

  • role="row" and aria-rowindex; body rows of a tree: level, position, expanded; row selection: selected.

    Parameters

    • rowDiv: HTMLDivElement
    • areaIdent: AreaIdent
    • areaModel: AreaModelIf
    • rowIndex: number
    • rowState: boolean = true

    Returns void

  • Marks the scroll position as changed (it is stored with the table state, see TableStateService).

    Returns void

    Deprecated

    since 1.1.92 – the table does this after every render pass.

  • Clears the selection in the component.

    Parameters

    • rerender: boolean = false

      Indicates whether to rerender the component after clearing the selection. Default value is false.

    Returns void

  • A client x coordinate (e.g. PointerEvent.clientX) as x in the host from the start of its padding box – the coordinates in which the table positions everything (right-to-left: from the right edge).

    Parameters

    • clientX: number

      x in client (viewport) coordinates

    Returns number

    px from the start

    Since

    1.1.98

  • Protected

    Draws big cells (rowspan and or colspan) in body/center

    Parameters

    • range: CellRange

      CellRange

    • xStart: number

      X position in pixel for top left corner

    • yStart: number

      Y position in pixel for top left corner

    • areaModel: AreaModelIf

      AreaModelIf

    • parentDiv: HTMLDivElement

      Parent div as HTMLDivElement

    • sideIdent: SideIdent

      SideIdent (west,center,east)

    Returns void

  • Protected

    Finds the row index of an important rowspan cell in a given area model.

    Parameters

    • areaModel: AreaModelIf

      The area model to search in.

    • rowIndex: number

      The current row index.

    • colIndex: number

      The current column index.

    Returns number

    • The row index of the important rowspan cell, or -1 if not found.
  • Protected

    Retrieves the specified area from the grid layout.

    Parameters

    • areaIdent: AreaIdent

      The identifier for the area ('header', 'body', or 'footer').

    • sideIdent: SideIdent

      The identifier for the side of the area ('west', 'center', or 'east').

    Returns DivScope

    • The requested area element.

    Throws

    • If the area identifier or side identifier is incorrect.
  • The width that % and weight columns share: host width minus the fixed west columns and a vertical scroll bar.

    Parameters

    • Optional hostWidth: number = ...

      the width of the host element (default: its current client width)

    Returns number

    the width in px (0 if the host has no width yet, e.g. while it is hidden)

  • The body cell at a point in host coordinates, clamped to the body (a point above the body = row 0, right of the columns = the last column …) – computed, not read from the DOM.

    Parameters

    • x: number

      x relative to the host's padding box

    • y: number

      y relative to the host's padding box

    Returns [number, number]

    row and column index, [-1, -1] without rows or columns

    Since

    1.1.96

  • The rectangle of a body cell in host coordinates (relative to the padding box of the host) – computed from the row and column positions, also for cells that are not rendered – and the visible part of its area (clip…: the body between header and footer, horizontally the fixed west/east area or the scrollable center).

    Parameters

    • rowIndex: number

      display index

    • columnIndex: number

      model index

    Returns {
        clipBottom: number;
        clipLeft: number;
        clipRight: number;
        clipTop: number;
        height: number;
        left: number;
        top: number;
        width: number;
    }

    the geometry

    • clipBottom: number
    • clipLeft: number
    • clipRight: number
    • clipTop: number
    • height: number
    • left: number
    • top: number
    • width: number

    Since

    1.1.96

  • The body row at a content position (a position in an open detail row belongs to its master row). Above the rows: 0, below: the last row, without rows: -1.

    Parameters

    • contentY: number

      px from the top of the first body row

    Returns number

    display index

    Since

    1.1.97

  • The positions of the body rows: prefix sums of the row heights (O(log n) lookups also for variable heights) plus the heights of open detail rows. Built lazily – again after invalidateRowLayout, a new body model or another row count.

    Returns RowLayout

    the layout of the body rows

    Since

    1.1.97

  • The top of a body row in content pixels: AreaModelIf.getYPosByRowIndex plus the heights of the open detail rows above it (master/detail).

    Parameters

    • rowIndex: number

      display index

    Returns number

    px from the top of the first body row

    Since

    1.1.97

  • The visible body in client (viewport) coordinates – including fixed west/east columns, without the scroll bar – and the content pixels scrolled out at its top. Row drag computes the row under the pointer with it.

    Returns {
        contentScrollTop: number;
        height: number;
        left: number;
        top: number;
        width: number;
    }

    the geometry

    • contentScrollTop: number
    • height: number
    • left: number
    • top: number
    • width: number

    Since

    1.1.95

  • Name of a row checkbox: "Select row 5" (body) resp. "Select all rows" (header).

    Parameters

    Returns string

  • The label of a column for screen readers: the header label of its column definition, otherwise the text of the lowest header row, otherwise the property.

    Parameters

    • columnIndex: number

      model column index

    Returns string

    e.g. "Total"

    Since

    1.1.91

  • The x position of a column relative to the host element: fixed west and east columns do not scroll.

    Parameters

    • columnIndex: number

      model index of the column

    • columnLeft: number

      x position of the column over all columns (getXPosByColumnIndex)

    Returns number

    the left position in px

  • Retrieves the column widths of a table within a specified range.

    Parameters

    • startIndex: number

      The index of the first column to retrieve the width of.

    • endIndex: number

      The index of the last column to retrieve the width of.

    Returns number[]

    An array containing the widths of the columns within the specified range.

  • Content pixels of the center columns scrolled out on the left – the offset that is actually rendered (see adjustColumnsToRowParent), the horizontal counterpart of contentScrollTop.

    Returns number

  • Scrollable range of the content in content pixels (content height minus visible body height).

    Returns number

  • Index of the first column that is not a row number column: 1 behind a RowNumberColumnDef, otherwise 0. The checkbox of showCheckboxWihoutExtraColumn and the tree arrow are bound to it.

    Returns number

    0 or 1

    Since

    1.1.93

  • The cell of the open editor inside a cell (getEditRenderer, the way before Excel-style editing).

    Returns undefined | [number, number]

    display row and model column, undefined without such an editor

    Since

    1.1.99

  • Protected

    Returns a number value extracted from the specified attribute of the source element.

    Parameters

    • srcElement: HTMLElement

      The source element from which to extract the attribute value.

    • key: string

      The attribute key to extract the value from.

    Returns number

    • The extracted number value, or -1 if the attribute was not found or not a valid number.
  • Retrieves the heights of rows within a specified range.

    Parameters

    • startIndex: number

      The index of the first row in the range.

    • endIndex: number

      The index of the last row in the range.

    • areaModel: AreaModelIf

      The area model.

    Returns number[]

    • An array containing the heights of the rows within the specified range.
  • Protected

    Retrieves the value of the specified attribute from the nearest ancestor element that has the attribute.

    Parameters

    • srcElement: HTMLElement

      The source element from which to start searching for the nearest ancestor element.

    • key: string

      The name of the attribute to retrieve.

    Returns string

    The value of the specified attribute, or an empty string if the attribute is not found.

  • Protected

    Retrieves the column index of the tree arrow column in the table.

    Returns number

    The column index of the tree arrow column: the first data column (0, behind a row number column 1), one more with a visible row checkbox column.

  • Hides the dragging column by applying a 'display: none' style to it. This method is protected and can only be accessed within the class.

    Returns void

  • Hides the hover row and column – e.g. while the pointer is over a detail row (master/detail).

    Returns void

    Since

    1.1.97

  • Protected

    Hide hover column.

    This method hides the hover column by applying a style of 'display: none' to the element representing the hover column.

    Returns void

    Memberof

    ClassName

  • Sets the static ARIA attributes of the host element: role="grid" (a tree body: "treegrid") and its name and description from the table options. Counts and the active cell follow with every render pass.

    Returns void

    Since

    1.1.91

  • Initializes and renders the editor for a specified row and column index.

    Parameters

    • rowIdx: number

      The index of the row.

    • colIdx: number

      The index of the column.

    Returns void

  • Marks the positions of the body rows as outdated (rows filtered, sorted, edited, added or removed, a detail row opened or closed) – they are computed again on the next access.

    Returns void

    Since

    1.1.97

  • false for a row number column: it has no resize handle (its width follows the numbers).

    Parameters

    • columnIndex: number

    Returns boolean

  • Width in px of a row number text: with the font and padding of a rendered number cell label; before the first number cell exists with the font of the host and 6 px padding on each side (then approximate is true). Digits are measured as "0" (tabular figures: all digits are as wide as the widest).

    Parameters

    • text: string

    Returns [number, boolean]

    the width and whether it is approximate

  • Mouse wheel on a capped scroll height: scale the wheel delta, so one wheel step still moves the content by the usual amount of pixels (otherwise it would jump many rows). No-op for normal tables.

    Parameters

    • evt: WheelEvent

      the wheel event of the scroll viewport

    Returns void

  • Recalculates the column widths of the table (% and weight columns depend on the available width) and repaints.

    Parameters

    • Optional clientWidth: number

      The (new) width of the host element, e.g. from a ResizeObserver. Default: its current width.

    Returns void

  • Renders the content of a dragging column.

    Parameters

    • columnGeo: GeoData

      The geographic data of the column.

    Returns void

    The y-coordinate of the rendered content.

  • Renders the content of the dragging column for a specific area.

    Parameters

    • columnGeo: GeoData

      The geometry data of the dragging column.

    • areaIdent: AreaIdent

      The identifier of the area.

    • Optional y: number = 0

      The starting y-position.

    • firstRowIndex: number = 0
    • maxY: number = Number.POSITIVE_INFINITY

    Returns number

    The final y-position after rendering all the content.

  • Repaints the UI by resetting the size of the wrapper div, adjusting the containers and rows, and performing additional adjustments after scrolling.

    Returns void

    This method does not return any value.

  • After updateCells() without a repaint: draws the rendered cells of calculated and „Show values as“ columns of the body again (they depend on the changed cells, e.g. total = price * quantity or a share of the total).

    Returns void

  • After updateCells() without a repaint: draws the rendered aggregate cells of the group rows of a row grouping again (they follow the changed rows; labels and counts don't change – a moved row repaints the whole table).

    Returns void

  • Resets the editor renderer by clearing its values and state.

    Returns void

    Function

    resetEditorRenderer

    Memberof

    ClassName

  • Gives an ARIA attribute of the host back the value it had before the table changed it (e.g. aria-busy after loading), or removes it if the host had none.

    Parameters

    • key: string

    Returns void

    Since

    1.1.92

  • Sets the height of the detail row behind one body row in the current row layout without building it again (a detail row was expanded or collapsed). Does nothing if the layout is outdated anyway.

    Parameters

    • rowIndex: number

      display index of the master row

    • height: number

      the detail height, 0 = none

    Returns boolean

    true if the layout was updated, false if it is outdated (it is built again on the next access)

    Since

    1.1.97

  • Remembers the text of the open in-cell editor (called on every input, see InputHandler) so that a repaint keeps it.

    Parameters

    • rowIndex: number

      display row index of the edited cell

    • columnIndex: number

      model column index

    • input: HTMLInputElement | HTMLTextAreaElement

      the editor element

    Returns void

    Since

    1.1.99

  • Sets (or with undefined removes) an ARIA attribute of the host and remembers the app's own value the first time, so that removeHostAria can restore it (e.g. an aria-label the app set on an Angular host).

    Parameters

    • key: string
    • value: undefined | string

    Returns void

    Since

    1.1.91

  • Writes a value without the column's editInputPipe (values copied inside the table are already converted – a pipe that expects text could break them). All area models apply the pipe in setValue, so it is left out for the call.

    Parameters

    • rowIndex: number
    • columnIndex: number
    • value: unknown

    Returns boolean

  • Protected

    Rounds a pixel offset to whole device pixels. The scroll offsets are derived from a scroll factor and are fractional; rows and cells placed at fractional positions render blurry text and 1px borders.

    Parameters

    • px: number

      offset in CSS pixels

    Returns number

    offset snapped to the device pixel grid

  • Updates the cells in the table with the provided values and optionally repaints all cells.

    Parameters

    • events: TableCellUpdateEventIf[]

      The array of events containing information about the cells to update.

    • repaintAll: boolean = false

      Optional. If true, repaints all cells after updating. Defaults to false.

    Returns void