Interface DetailRenderContextIf<T>

The context a DetailRendererIf gets: the master row, the outer table and helpers whose resources are released together with the detail row.

Example

const renderDetail: DetailRenderFnType<Order> = (container, order, ctx) => {
const button = document.createElement("button");
button.textContent = `Open order ${order.id}`;
button.addEventListener("click", () => ctx.tableApi.announce(`Order ${order.id}`), { signal: ctx.signal });
container.appendChild(button);
};

Since

1.1.97

Type Parameters

  • T = any

Hierarchy

  • DetailRenderContextIf

Properties

recreated: boolean

true if the content of this detail row existed before and was destroyed (too many rendered details, see MasterDetailOptionsIf.maxRenderedDetails, or TableApi.refreshDetail) – state that lives only in the DOM (inputs, scroll positions) is gone then.

row: T

The master row (the row object of the body model).

rowIndex: number

The display index of the master row when the detail was created (it changes with sorting and filtering).

signal: AbortSignal

Aborted when the detail row is destroyed – pass it to addEventListener(…, { signal }).

tableApi: TableApi

The API of the outer (master) table.

Methods