Documentation

@kanunilabs/datagrid-react


@kanunilabs/datagrid-react / GridToolbarProps

Interface: GridToolbarProps<TRow>

Type Parameters

TRow

TRow = GridRowData

Properties

columnChooser?

optional columnChooser?: boolean


controller

controller: DataGridController<TRow>


dark?

optional dark?: boolean


exportCsv?

optional exportCsv?: boolean


exportExcel?

optional exportExcel?: boolean


exportPdf?

optional exportPdf?: boolean

Offer PDF. Off by default for the same reason Excel is: jspdf and jspdf-autotable are OPTIONAL peers, so a menu entry that is always there would fail on a grid that never installed them.


itemsAfter?

optional itemsAfter?: ReactNode


itemsBefore?

optional itemsBefore?: ReactNode

Extra controls. before sits ahead of the built-ins, after behind them — the spacer between search and the buttons keeps the two groups apart.

Nodes rather than a descriptor object: a toolbar item is arbitrary UI (a date range, a saved-view picker, a refresh button wired to the app's own store), and every descriptor schema ends up chasing the next widget.


labels?

optional labels?: Partial<Record<"exporting" | "search" | "csv" | "excel" | "excelSelected" | "pdf" | "columns" | "exportMenu", string>>


onOpenColumnChooser?

optional onOpenColumnChooser?: (anchor) => void

Opens the field chooser anchored under the button. The panel itself is owned by the grid, because the header menu can open it in a grid that renders no toolbar.

Parameters

anchor
left

number

top

number

Returns

void


optional search?: boolean


searchDebounce?

optional searchDebounce?: number

Milliseconds to wait after the last keystroke. Default 200.