API reference: @salmonui/data-grid
DataGridDetailPropsinterface
import type { DataGridDetailProps } from '@salmonui/data-grid';interface DataGridDetailProps<Row> {
renderDetail?: (ctx: DataGridDetailContext<Row>) => ReactNode;
detailHeight?: number;
hasDetail?: (row: Row) => boolean;
loadDetail?: (ctx: DataGridDetailLoadContext<Row>) => unknown;
defaultExpandedDetails?: boolean | readonly RowId[];
childGrid?: DataGridChildGrid<unknown, Row>;
onBeforeDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void;
onDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void;
rowDrag?: boolean | DataGridRowDrag;
onRowDragStart?: (event: DataGridRowDragEvent<Row>) => void;
onRowDrag?: (event: DataGridRowDragEvent<Row>) => void;
onBeforeRowDrop?: (event: DataGridRowDragEvent<Row>) => void;
onRowDrop?: (event: DataGridRowDragEvent<Row>) => void;
renderRowDragPreview?: (ctx: DataGridRowDragPreviewContext<Row>) => ReactNode;
}
| Name | Signature | Description |
|---|---|---|
renderDetailoptional | renderDetail?: (ctx: DataGridDetailContext<Row>) => ReactNode; | Detail row content below each expanded row. |
detailHeightoptional | detailHeight?: number; | Estimated detail row height in px before measurement. Default 150. |
hasDetailoptional | hasDetail?: (row: Row) => boolean; | Rows without a detail (no toggle). Called for rendered rows only. |
loadDetailoptional | loadDetail?: (ctx: DataGridDetailLoadContext<Row>) => unknown; | Async detail content, started on expand; |
defaultExpandedDetailsoptional | defaultExpandedDetails?: boolean | readonly RowId[]; | Initially expanded details: |
childGridoptional | childGrid?: DataGridChildGrid<unknown, Row>; | Child grid inside each expanded row (hierarchy grid). An inline object
sees child rows as |
onBeforeDetailToggleoptional | onBeforeDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void; | |
onDetailToggleoptional | onDetailToggle?: (event: DataGridDetailToggleEvent<Row>) => void; | |
rowDragoptional | rowDrag?: boolean | DataGridRowDrag; | Row drag and drop with a drag handle column; |
onRowDragStartoptional | onRowDragStart?: (event: DataGridRowDragEvent<Row>) => void; | Cancel with |
onRowDragoptional | onRowDrag?: (event: DataGridRowDragEvent<Row>) => void; | Once per animation frame while dragging. |
onBeforeRowDropoptional | onBeforeRowDrop?: (event: DataGridRowDragEvent<Row>) => void; | Cancel with |
onRowDropoptional | onRowDrop?: (event: DataGridRowDragEvent<Row>) => void; | |
renderRowDragPreviewoptional | renderRowDragPreview?: (ctx: DataGridRowDragPreviewContext<Row>) => ReactNode; | Drag preview content (default: the first cell text and the row count). |