Master/detail of a table (TableOptionsIf.masterDetail): the expanded master rows, the detail layer and the life cycle of the detail contents. Created by TableScope (tableScope.masterDetailService); use the TableApi (setDetailExpanded, toggleDetail …).

  • Layer: one div ge-table-detail-layer in the host, over the body (full width, fixed columns included, without the scroll bars). It is never cleared by the virtual rendering and does not scroll horizontally.
  • Positions: the heights of the detail rows are extras of the body RowLayout (behind their master row); RenderScope reports the detail rows in view after every render pass (layoutVisible).
  • Life cycle: the content is created when the detail row becomes visible, hidden (not destroyed) when it scrolls out of view, destroyed when it is collapsed, beyond maxRenderedDetails or when the table is destroyed.
  • Events: mouse, keyboard and pointer events from a detail row are ignored by the outer table (isInLayer); the mouse wheel over a detail row scrolls the outer table when nothing in the detail scrolls.

Since

1.1.97

Hierarchy

  • MasterDetailService

Constructors

Properties

options: MasterDetailOptionsIf<any>

The complete options (defaults + tableOptions.masterDetail).

Methods

  • The display indices and heights of the expanded master rows that are shown – the extras of the body row layout. Called by RenderScope when the row layout is built (after filtering, sorting, editing, a detail toggle …): one pass over the shown rows. Removes expanded rows that no longer exist in the model (getAllRows()).

    Returns undefined | {
        heights: number[];
        rowIndices: number[];
    }

    the extras, undefined without expanded rows

  • Decorates a body cell of the toggle column of a master row with the expand icon (ge-table-detail-toggle).

    Parameters

    • cell: HTMLDivElement

      the rendered cell

    • rowIndex: number

      display index

    • columnIndex: number

      model column index

    Returns void

  • The container of a detail row (the element detailRenderer renders into) – only while its content exists.

    Parameters

    • rowOrIndex: unknown

      display index or row object

    Returns undefined | HTMLDivElement

    the container

  • The display index of the master row a DOM node belongs to (a detail row or something in it).

    Parameters

    • node: null | Node

      a node in the detail layer

    Returns number

    the display index, -1 if none

  • True if Tab on the master row rowIndex goes into its open detail row (a focusable element in it) – Excel-style editing then leaves Tab to this service.

    Parameters

    • rowIndex: number

      display row index of the focused cell

    Returns boolean

    true with a tab target

    Since

    1.1.99

  • True if an event comes from a detail row (or a nested table in it) – the outer table ignores it.

    Parameters

    • evt: Event

      a DOM event while it is dispatched

    Returns boolean

    whether its path contains the detail layer

  • Destroys the content of a detail row and creates it again (e.g. after the row's data changed).

    Parameters

    • rowOrIndex: unknown

      display index or row object

    Returns boolean

    false if the row is not expanded

  • Position and size of the layer: the visible body including the fixed columns, without the scroll bars.

    Parameters

    • left: number

      px in the host

    • top: number

      px in the host (below the header)

    • width: number

      px

    • height: number

      px

    Returns void

  • Expands or collapses a master row. The table repaints and reports the change (TableScope).

    Parameters

    • rowOrIndex: unknown

      display index or row object

    • expanded: boolean

      the new state

    • Optional source: GeDetailEventSource = "api"

      what changed it (for the event)

    Returns boolean

    false if nothing changed (no master row, already in that state, no master/detail)

  • Expands exactly these rows and collapses all others – the restore of the table state. Rows that are no master rows are skipped. No event per row.

    Parameters

    • rows: readonly unknown[]

      row objects of the body model

    • Optional source: GeDetailEventSource = "api"

      what changed it

    Returns boolean

    true if something changed