Skip to content

TypeDefault

Type default configuration for React applications.

Defines default renderer, editor, and editorParams for a data type using React function components.

import type { TypeDefault } from '@toolbox-web/grid-react';
const countryDefault: TypeDefault<Employee, string> = {
renderer: (ctx) => <CountryFlag code={ctx.value} />,
editor: (ctx) => (
<CountrySelect value={ctx.value} onSelect={ctx.commit} />
),
};
PropertyTypeDescription
renderer?(ctx: CellRenderContext<TRow, TValue>) => ReactNodeReact component/function for rendering cells of this type
editor?(ctx: ColumnEditorContext<TRow, TValue>) => ReactNodeReact component/function for editing cells of this type
editorParams?Record<string, unknown>Default editorParams for this type
filterPanelRenderer?(params: FilterPanelParams) => ReactNodeCustom filter panel renderer for this type. Requires FilteringPlugin.

Custom filter panel renderer for this type. Requires FilteringPlugin.

Returns JSX to render as the custom filter panel content. The rendered content is mounted into the filter panel container.

filterPanelRenderer: (params) => (
<MyFilterPanel
field={params.field}
uniqueValues={params.uniqueValues}
onApply={(values) => params.applySetFilter(values)}
onClear={params.clearFilter}
/>
)

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