View as Markdown

API reference: @salmonui/data-grid

DataGridDetailApiinterface

import type { DataGridDetailApi } from '@salmonui/data-grid';
interface DataGridDetailApi {
    expandDetail(rowId: RowId): DataGridActionResult;
    collapseDetail(rowId: RowId): DataGridActionResult;
    toggleDetail(rowId: RowId, expanded?: boolean): DataGridActionResult;
    expandAllDetails(): DataGridActionResult;
    collapseAllDetails(): DataGridActionResult;
    isDetailExpanded(rowId: RowId): boolean;
    getChildGrid(rowId: RowId): DataGridApi<unknown> | null;
    moveRows(rowIds: RowId | readonly RowId[], to: number | DataGridMoveTarget): DataGridActionResult;
}
DataGridDetailApi members (8)
NameSignatureDescription
expandDetailexpandDetail(rowId: RowId): DataGridActionResult;
collapseDetailcollapseDetail(rowId: RowId): DataGridActionResult;
toggleDetailtoggleDetail(rowId: RowId, expanded?: boolean): DataGridActionResult;

Toggles one detail row; expanded forces a state.

expandAllDetailsexpandAllDetails(): DataGridActionResult;
collapseAllDetailscollapseAllDetails(): DataGridActionResult;
isDetailExpandedisDetailExpanded(rowId: RowId): boolean;
getChildGridgetChildGrid(rowId: RowId): DataGridApi<unknown> | null;

The mounted child grid of a parent row (null when collapsed or not rendered).

moveRowsmoveRows(rowIds: RowId | readonly RowId[], to: number | DataGridMoveTarget): DataGridActionResult;

Moves rows so the first one ends at data row index toIndex, or next to / into a target row ({ targetRowId, position }; into makes them the last children of the target in tree mode).