Interface MasterDetailOptionsIf<T>

Master/detail: a master row can be expanded; below it a detail row over the full width of the table (fixed columns included) shows any content – a nested GuiExpert table, a form, a chart, a framework component. Works with virtual scrolling and millions of rows: the content is created when the detail row becomes visible and lives until it is collapsed (scrolling only hides and shows it). Only for flat body models (not for trees, row groups and pivot tables).

Fields you leave out keep their default (MasterDetailOptions).

Example

const tableOptions: TableOptionsIf = {
...new TableOptions(),
masterDetail: {
detailHeight: 180,
detailRenderer: (_container, order: Order, ctx) => {
ctx.createTable({
tableModel: TableFactory.createTableModel({ rows: order.items, properties: ["sku", "name", "qty", "price"] })
});
}
}
};

See

Training: Master/detail

Since

1.1.97

Type Parameters

  • T = any

Hierarchy

  • MasterDetailOptionsIf

Implemented by

Properties

detailHeight: DetailHeightType | ((row, rowIndex) => DetailHeightType)

Height of the detail rows: px, "auto" (measured) or a function per row. Default "auto".

Type declaration

detailRenderer: DetailRendererIf<T> | DetailRenderFnType<T>

Renders the content of a detail row (function or object with render()).

estimatedDetailHeight: number

Height of an "auto" detail row before its content was measured (px). Default 200.

getRowId?: ((row) => string | number)

Type declaration

    • (row): string | number
    • The id of a master row – keeps detail rows open when the rows are replaced by new objects with the same ids (setRows). Default: autoRestoreOptions.getRowId, otherwise the row object itself.

      Parameters

      • row: T

      Returns string | number

isMaster?: ((row, rowIndex) => boolean)

Type declaration

    • (row, rowIndex): boolean
    • Which rows can be expanded. Default: every row.

      Parameters

      • row: T
      • rowIndex: number

      Returns boolean

maxRenderedDetails: number

At most this many detail contents exist at the same time. Beyond it the detail row that was out of view the longest is destroyed and created again when it scrolls back into view (context.recreated). Default 50.

toggleColumn?: string | number

The column with the expand/collapse icon: column index or property. Default: the first data column (behind a row number and a row checkbox column – where a tree has its arrow).