# DataGridDetailApi (@salmonui/data-grid)

> The DataGridDetailApi interface of @salmonui/data-grid.

Canonical: https://salmonui.dev/docs/reference/data-grid/DataGridDetailApi

```ts
import type { DataGridDetailApi } from '@salmonui/data-grid';
```

Entry index: https://salmonui.dev/docs/reference/data-grid (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid.md).

## Reference

Kind: interface

```ts
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;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `expandDetail` | `expandDetail(rowId: RowId): DataGridActionResult;` |  |  |
| `collapseDetail` | `collapseDetail(rowId: RowId): DataGridActionResult;` |  |  |
| `toggleDetail` | `toggleDetail(rowId: RowId, expanded?: boolean): DataGridActionResult;` |  | Toggles one detail row; `expanded` forces a state. |
| `expandAllDetails` | `expandAllDetails(): DataGridActionResult;` |  |  |
| `collapseAllDetails` | `collapseAllDetails(): DataGridActionResult;` |  |  |
| `isDetailExpanded` | `isDetailExpanded(rowId: RowId): boolean;` |  |  |
| `getChildGrid` | `getChildGrid(rowId: RowId): DataGridApi<unknown> \| null;` |  | The mounted child grid of a parent row (null when collapsed or not rendered). |
| `moveRows` | `moveRows(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). |
