API reference: @salmonui/data-grid
DataGridTreeApiinterface
import type { DataGridTreeApi } from '@salmonui/data-grid';interface DataGridTreeApi<Row> {
expandAllTreeRows(): DataGridActionResult;
collapseAllTreeRows(): DataGridActionResult;
expandTreeLevel(depth: number): DataGridActionResult;
collapseTreeLevel(depth: number): DataGridActionResult;
expandTreeRows(rowIds: RowId | readonly RowId[]): DataGridActionResult;
collapseTreeRows(rowIds: RowId | readonly RowId[]): DataGridActionResult;
toggleTreeRow(rowId: RowId, expanded?: boolean): DataGridActionResult;
indentRows(rowIds: RowId | readonly RowId[]): DataGridActionResult;
outdentRows(rowIds: RowId | readonly RowId[]): DataGridActionResult;
getTreeRow(rowId: RowId): DataGridTreeRowInfo | null;
getChildRows(rowId: RowId | null): readonly Row[];
reloadTreeChildren(rowId: RowId): DataGridActionResult;
getVisibleRows(): readonly Row[];
}
Tree methods of DataGridApi (rejected or empty without tree).
| Name | Signature | Description |
|---|---|---|
expandAllTreeRows | expandAllTreeRows(): DataGridActionResult; | |
collapseAllTreeRows | collapseAllTreeRows(): DataGridActionResult; | |
expandTreeLevel | expandTreeLevel(depth: number): DataGridActionResult; | Expands the parents at |
collapseTreeLevel | collapseTreeLevel(depth: number): DataGridActionResult; | |
expandTreeRows | expandTreeRows(rowIds: RowId | readonly RowId[]): DataGridActionResult; | |
collapseTreeRows | collapseTreeRows(rowIds: RowId | readonly RowId[]): DataGridActionResult; | |
toggleTreeRow | toggleTreeRow(rowId: RowId, expanded?: boolean): DataGridActionResult; | |
indentRows | indentRows(rowIds: RowId | readonly RowId[]): DataGridActionResult; | Moves rows under their previous sibling. |
outdentRows | outdentRows(rowIds: RowId | readonly RowId[]): DataGridActionResult; | Moves rows after their parent, as its siblings. |
getTreeRow | getTreeRow(rowId: RowId): DataGridTreeRowInfo | null; | |
getChildRows | getChildRows(rowId: RowId | null): readonly Row[]; | Kept children of a row in view order ( |
reloadTreeChildren | reloadTreeChildren(rowId: RowId): DataGridActionResult; | Salmon: retries a failed lazy child load. |
getVisibleRows | getVisibleRows(): readonly Row[]; | Visible data rows in view order. |