GridDetailPanel
Component for defining a master-detail panel within a DataGrid.
Renders a <tbw-grid-detail> custom element in the light DOM that the
MasterDetailPlugin picks up to render expandable row details.
import { DataGrid, GridDetailPanel } from '@toolbox-web/grid-react';import { MasterDetailPlugin } from '@toolbox-web/grid/all';
function EmployeeGrid() { const config = { plugins: [new MasterDetailPlugin()], // ... other config };
return ( <DataGrid rows={employees} gridConfig={config}> <GridDetailPanel showExpandColumn animation="slide"> {({ row }) => ( <div className="detail-panel"> <h3>{row.firstName} {row.lastName}</h3> <p>Department: {row.department}</p> <p>Email: {row.email}</p> </div> )} </GridDetailPanel> </DataGrid> );}How it works
Section titled “How it works”- This component renders a
<tbw-grid-detail>element in the grid’s light DOM - The ReactGridAdapter detects this element and creates a detail renderer
- When a row is expanded, the adapter calls your render function
- The React component is rendered into the detail row container
GridDetailPanel(props: GridDetailPanelProps<TRow>): ReactElementParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
props | GridDetailPanelProps<TRow> |
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt