API reference
ProGrid props
The complete component surface, grouped by responsibility. Types shown here mirror the exported TypeScript definitions in components/pro-grid/types.ts.
Imports
import {
ProGrid,
type ProGridHandle,
type ProGridProps,
type ProColumnDef,
type ProColumnMeta,
} from "@/components/pro-grid"Data and columns
The row model and the definitions that give those rows meaning.
| Prop | Type | Default | Description |
|---|---|---|---|
data | T[] | [] | Rows to render. Supply the full dataset in client mode or the current page in controlled server mode. Optional when dataSource is provided. |
columnsRequired | ProColumnDef<T>[] | — | Typed TanStack column definitions with optional ProGrid metadata. This is the component’s only required prop. |
getRowId | (row: T, index: number) => string | row index | Returns a stable row key. Provide it when selection, expansion, or live refresh must survive sorting and reordering. |
isRowAggregable | (row: T) => boolean | every row | Deprecated since 1.4: return skip from an aggFns entry instead. Still honoured — a record it returns false for is left out of every aggregate. |
aggFns | AggFns<T> | — | Aggregation functions by name, for every column: (value, row, skip) => value adjusts a built-in (sum, avg, …) or defines a new, summed one; the object form adds aggregate(values, rows) for a reduction of its own, label, and server. A column's meta.aggFns wins for that column. Keep it referentially stable. |
Layout and language
Viewport sizing, presentation hooks, and localized grid chrome.
| Prop | Type | Default | Description |
|---|---|---|---|
height | number | string | 560 | Grid viewport height. The body scrolls and virtualizes inside this boundary. |
maxHeight | number | string | — | Caps an auto-height viewport. Also gives the virtualizer a measurable window when height is auto. |
rowHeight | number | 34 | Estimated row height in pixels. Rows may grow after measurement when their content requires it. |
columnVirtualization | boolean | automatic | Mounts only visible center columns. When omitted, it turns on above 20 visible columns; pinned columns remain mounted. |
fitColumns | boolean | false | Grows columns to fill the body when declared widths add up to less than it, sharing surplus in proportion to each column’s size. Columns are never shrunk below their declared width. |
className | string | — | Additional class name applied to the grid’s outer container. |
locale | "en" | "pt" | "en" | Language for menus, filters, pagination, status text, and ARIA labels. Host-provided headers and cells are not translated. |
title | string | — | Optional visible title rendered at the start of the toolbar. |
emptyMessage | ReactNode | localized message | Content shown when there are no rows and no request is loading. |
State and selection
Seed, observe, or control the interaction state at the granularity your host needs.
| Prop | Type | Default | Description |
|---|---|---|---|
initialGrouping | string[] | [] | Column IDs grouped on first render. Later user changes are not overwritten by prop updates. |
initialPivot | PivotState | PivotConfig | LegacyPivotConfig | boolean | — | Seeds pivot mode and its configuration on first render; `true` turns pivot on with no fields chosen. Also accepts the legacy single-row-list, single-pivot-column shape for a hand-written or restored config. |
pivotOptions | PivotOptions | — | Presentation and limits for the pivot — row layout, grand totals, initial expand depth, drill-through, and axis caps. |
initialState | ProGridInitialState | {} | First-render sorting, filters, pinning, visibility, and column order for internally managed slices. |
state | Partial<ProGridState> | — | Controlled state slices. Each supplied slice stops being internally owned; omitted slices remain uncontrolled. |
onStateChange | (state: ProGridState) => void | — | Runs after any grid state change with the complete next public state, including uncontrolled slices. |
rowSelection | boolean | true | Shows the checkbox selection column. Disable it when the host owns a separate selection model. |
cellSelection | boolean | true | Enables rectangular cell-range selection with pointer and keyboard input. |
Row interactions
Row styling, gestures, detail panels, and navigation behavior.
| Prop | Type | Default | Description |
|---|---|---|---|
rowClassName | (row: Row<T>) => string | undefined | — | Adds classes to each body row for host-specific states such as disabled, overdue, or externally selected. |
onRowClick | (row: Row<T>) => void | — | Runs after a primary pointer click on a row. |
onRowDoubleClick | (row: Row<T>) => void | — | Runs after a row is double-clicked. |
onRowLongPress | (row: Row<T>) => void | — | Runs after an approximately 400 ms press, useful for touch-first selection behavior. |
rowActions | RowActionsConfig<T> | — | A menu of record-level actions in the utility column, plus the same menu in its header for the selected rows. Items may be an array or a function of the row; position chooses between sharing the checkbox column and a column of its own pinned right. |
onNavigate | (link: CellLink) => void | browser navigation | Handles a link discovered in the context-clicked cell. Pass the host router to keep navigation client-side. |
getRowCanExpand | (row: Row<T>) => boolean | all rows with details | Controls which rows may open a detail panel. Used with renderDetail. |
renderDetail | (row: Row<T>) => ReactNode | — | Renders an expandable detail panel directly beneath its parent row. |
treeData | TreeDataConfig<T> | — | Hierarchical rows: getSubRows returns a row's children, the tree column gets an indent and chevron per level, filtering keeps the parents of a match, and sorting orders siblings. Turns row grouping and pivot off; client-side only. |
groupRows | (rows: Row<T>[]) => { header: ReactNode; rows: Row<T>[] }[] | null | — | Splits rows into labeled custom blocks. This output is unvirtualized and intended for small collections. |
Editing
Let readers change cells in place; the grid reports every change and never writes into your rows.
| Prop | Type | Default | Description |
|---|---|---|---|
editing | boolean | EditingConfig | true | Cell editing, which a column opts into with meta.editable. false makes the grid read-only whatever its columns say; an object chooses what opens an editor (startOn), where Enter goes afterwards (enterMoves), and whether changed cells are tinted (highlightEdits, on by default). |
onCellEdit | (change: CellEditChange<T>) => void | boolean | Promise<void | boolean> | — | Runs once per committed cell with the row, column, old and new values. Return false or reject to decline; with liveUpdates the shown value is then put back. |
onBatchEdit | (changes: CellEditChange<T>[], source: "edit" | "paste" | "clear") => void | boolean | Promise<void | boolean> | — | Runs instead of onCellEdit for a paste or a range clear, with every change at once. Without it, onCellEdit is called per cell. |
isCellEditable | (row: Row<T>, columnId: string) => boolean | — | Per-row exceptions to meta.editable, such as a locked or archived record. |
applyCellEdit | (row: T, columnId: string, value: unknown) => T | accessorKey path | How the optimistic patch writes a value into a row under liveUpdates. Needed only for accessorFn columns, where the grid cannot know the field. |
Pagination and server data
Choose local paging, grid-owned requests, or a fully controlled request layer.
| Prop | Type | Default | Description |
|---|---|---|---|
pagination | boolean | PaginationConfig | false | Enables page controls or infinite loading. A config sets mode, initial page size, choices, and control placement. |
dataSource | DataSource<T> | — | Async grid-driven fetcher called with the normalized query, an AbortSignal, and the column-to-API-field context. Returns { data, totalRows, pageNumber, pageSize, totalPages, aggregates } or the legacy { rows, total }. Build one with createRestDataSource. The grid owns loading, errors, cancellation, and refresh. |
rowCount | number | — | Total rows matching the current server query. Pass with data and onQueryChange for controlled server mode. |
aggregates | GridAggregates | — | Controlled server mode: grand totals over every matching row, keyed by column id, as query.aggregates asked for them. null renders blank; a missing key falls back to a page-scoped total. Ignored with dataSource. |
onQueryChange | (query: GridQuery) => void | — | Reports page, page size, sorting, filters, quick filter, grouping, and the aggregates to compute whenever the normalized query changes. |
loading | boolean | false | Controlled-mode loading state. dataSource mode manages the same presentation automatically. |
onRefresh | () => void | — | Overrides the built-in refresh action. Use it when the host, rather than dataSource, owns fetching. |
serverSide | boolean | inferred | Forces server semantics. Otherwise inferred when dataSource or rowCount is present. |
serverOperators | boolean | FilterOperator[] | false | Restricts filter choices to what the API can express and forces the AND join. true hides not-in and not-blank; pass an explicit list, typically source.supportedOperators, to match your dialect exactly. |
liveUpdates | boolean | LiveUpdateConfig<T> | false | Enables row transactions on the handle so a feed can patch rows instead of replacing the dataset. Requires getRowId and a referentially stable data array; a config tunes batching, cell flashing, the totals throttle, and a row cap. |
Persistence
Save and restore layout, sort, filters, and paging across sessions, and switch between named views.
| Prop | Type | Default | Description |
|---|---|---|---|
persist | PersistConfig | — | Saves chosen state slices to localStorage, sessionStorage, or a custom adapter, keyed by persist.key. Off unless a key is given; restore applies after mount, so the first paint always shows the default layout. |
views | boolean | GridViewsConfig | false | Saved views: named sets of columns, sort, filters, grouping, aggregations and pivot, switched from a toolbar menu. Each view writes only the parts it was saved with, so a view without filters rearranges whatever the reader has filtered. true keeps them in localStorage under persist.key; items + onChange keep them in your own store. |
State shapes
Initial values are intentionally smaller than the observable state: only layout and query defaults that are safe to seed are accepted.
type ProGridInitialState = {
sorting?: SortSpec[]
columnFilters?: ColumnFilter[]
columnPinning?: { left?: string[]; right?: string[] }
columnVisibility?: Record<string, boolean>
columnOrder?: string[]
}type ProGridState = {
sorting: SortSpec[]
columnFilters: ColumnFilter[]
quickFilter: string
grouping: string[]
// The aggregation picked in each column's menu; unlisted columns use meta.defaultAgg.
aggregations: Record<string, AggFn>
pivot: PivotState
columnVisibility: Record<string, boolean>
columnOrder: string[]
columnPinning: { left?: string[]; right?: string[] }
columnSizing: Record<string, number>
rowSelection: Record<string, boolean>
pagination: { pageIndex: number; pageSize: number }
}Toolbar controls
Every built-in control takes three values: true gives it a button, false removes it, and "menu" moves it into the toolbar’s settings dropdown — the gear at the right end, which appears only once something is in it. A config of plain booleans renders the toolbar it always did.settings: false removes the gear outright; any control still set to "menu" falls back to its own button rather than disappearing.
type ToolbarControl = boolean | "menu"
type ToolbarConfig = {
// Quick-filter search box. Boolean only: a text field
// has no place in a menu. Defaults to true.
quickFilter?: boolean
// Expand-all / collapse-all. Only while grouped.
expand?: ToolbarControl
// Pivot mode toggle. Off in server mode unless set explicitly (then page-scoped).
pivot?: ToolbarControl
// Chart button.
chart?: ToolbarControl
// Column chooser.
columns?: ToolbarControl
// Refresh button.
refresh?: ToolbarControl
// Filter-surface toggle. Only when `filters` mounts one.
filters?: ToolbarControl
// Row-group picker. Only when a column is groupable.
groups?: ToolbarControl
// CSV / Excel export. Defaults to "menu".
export?: ToolbarControl
// Shows/hides the column-header funnels. Defaults to "menu".
headerFilters?: ToolbarControl
// "Reset settings". Defaults to "menu"; asks for a second click.
reset?: ToolbarControl
// Saved-views menu, beside the title. Only when `views` is on.
views?: ToolbarControl
// The gear itself. Boolean only. false falls any "menu"
// control below back to a button instead of dropping it.
settings?: boolean
}Filter surfaces
The filters prop mounts a cross-column filter surface. It never replaces the column-header funnels — both edit columnFilters, so they cannot disagree. For a filter UI of your own, mount none of these and use useGridFilters instead.
type FilterConfig = {
// Where the cross-column surface mounts. Defaults to "none".
placement?: "none" | "top" | "left" | "dialog"
// Column-header funnel icons. Defaults to true.
headerFilters?: boolean
// Which columns the surface offers, and in what order.
columns?: string[]
// Starts open. Defaults to true for "top"/"left", false for "dialog".
defaultOpen?: boolean
// Rail width in px. "left" only; defaults to 260.
width?: number
// Moves the quick-filter search into the surface, out of the toolbar.
quickFilter?: boolean
}Row actions
rowActions puts a ⋮ menu in the utility column and the same menu in its header, over the current selection. Group and aggregate rows never get one — they stand for a bucket rather than a record. variant colours an item and nothing more: a destructive action that needs confirming should ask in its own onSelect.
type RowActionVariant = "default" | "primary" | "destructive" | "warning"
type RowAction<T> = {
id: string
label: ReactNode
icon?: ReactNode
variant?: RowActionVariant // styling only; no confirmation is implied
disabled?: boolean // greyed, but still visible
hidden?: boolean // dropped from the menu entirely
onSelect: (ctx: { row?: Row<T>; rows: Row<T>[]; table: Table<T> }) => void
}
type RowActionsConfig<T> = {
position?: "leading" | "trailing" // default "leading"
items?: RowAction<T>[] | ((row: Row<T>) => RowAction<T>[])
// The header menu, over the selection. Defaults to `items` when that is an
// array; a function form takes one row, so it does not carry over.
bulkItems?: RowAction<T>[] | ((rows: Row<T>[]) => RowAction<T>[])
// Replace the chrome but keep the config as the description of the actions.
renderCell?: (ctx: { row: Row<T>; items: RowAction<T>[]; run: (item: RowAction<T>) => void; table: Table<T> }) => ReactNode
renderHeader?: (ctx: { rows: Row<T>[]; items: RowAction<T>[]; run: (item: RowAction<T>) => void; table: Table<T> }) => ReactNode
width?: number
isRowActionable?: (row: Row<T>) => boolean
triggerLabel?: string
}Pivot
initialPivot seeds the cross-tab and pivotOptions sets how it presents. The configuration itself is a state slice, so a controlled grid reads and writes it through state.pivot and onStateChange like any other — there is no separate pivot channel to keep in step. A measure’s showAs changes how a number is reported, never how it is computed, so the underlying figures survive for drill-through and raw export.
type BuiltInAggFn =
| "sum" | "avg" | "min" | "max" | "count" | "none"
| "median" | "distinctCount" | "first" | "last"
| "stddev" | "product"
// A built-in, or any name defined in aggFns (on the grid or the column).
type AggFn = BuiltInAggFn | (string & {})
type PivotField = {
colId: string
label?: string
// Member order. "measure" sorts a level's members within
// their parent, which a flat table sort cannot express.
sort?:
| { by: "value"; dir: "asc" | "desc" }
| { by: "measure"; valueIndex: number; colPath?: string[]; dir: "asc" | "desc" }
| { by: "manual"; order: string[] }
subtotal?: boolean // default true
subtotalPlacement?: "top" | "bottom" // default "bottom"
bucket?: "none" | "day" | "week" | "month" | "quarter" | "year"
exclude?: string[] // hidden members
}
// A measure: an aggregation of a column, or a formula over
// the other measures ("[Sum of Revenue] / [Sum of Units]").
type PivotValue =
| { kind?: "agg"; colId: string; agg: AggFn; label?: string; showAs?: PivotShowAs; formatValue?: (value: unknown) => string }
| { kind: "calc"; id: string; label: string; expr: string; showAs?: PivotShowAs; formatValue?: (value: unknown) => string }
type PivotConfig = {
rows: PivotField[]
columns: PivotField[]
values: PivotValue[]
// Narrow the source rows before anything is aggregated.
filters: { colId: string; include?: string[]; exclude?: string[]; bucket?: "none" | "day" | "week" | "month" | "quarter" | "year" }[]
}
type PivotState = {
enabled: boolean
config: PivotConfig
// Open levels, stored as exceptions to a default depth.
rows: { depth: number; collapsed: string[]; expanded: string[] }
columns: { depth: number; collapsed: string[]; expanded: string[] }
}
type PivotOptions = {
rowLayout?: "outline" | "tabular" // default "outline"
grandTotalRow?: boolean // default true
grandTotalColumn?: boolean // default true
pinGrandTotalColumn?: boolean // default true
initialExpandDepth?: number // default 1
drillThrough?: boolean // default true
fieldPanelWidth?: number // default 280
blankLabel?: string
// Caps, so a high-cardinality mistake truncates rather than
// exhausting memory. Defaults: 512 columns, 50,000 row nodes.
limits?: { maxColumnLeaves?: number; maxRowNodes?: number }
}Header & cell rendering
header and cell are plain TanStack column definition fields, not ProGrid props: each accepts a string or a function returning a ReactNode, called with the standard TanStack header/cell context (column, row, table,getValue()).
Column metadata
Attach these fields to a column’s meta object. They extend TanStack’s standard column definition.
| Field | Type | Description |
|---|---|---|
label | string | Short name used in menus, chips, and the column chooser. Also the fallback header text for clipboard copy and column-width autosizing when header is a function instead of a plain string — set it whenever header or headerIcon isn't a string. |
type | "string" | "number" | "date" | "boolean" | "array" | What the column's values are. Declaring it attributes the operator set, the filter editor, the operator wording, and how values compare — and offers the column to the chart, as a measure when it is a number and as a category otherwise. Omit it for a column with no filter. |
filterable | boolean | Set false to keep the type without the filter, for a column typed only so the chart or an aggregation reads it correctly. |
filterVariant | "text" | "number" | "set" | "date" | "boolean" | Overrides the editor derived from type. Rarely needed — options on the column already imply the list editor; use it for a string column whose choices come from the loaded rows instead. |
filterOptions | FilterOption[] | Visible choices for a set filter; required for authoritative options in server mode. |
filterField | string | API field name used for this column's filters and sort, when it differs from the column ID. Read by the data adapter; GridQuery itself keeps column IDs. |
filterCondition | string | Pins this column's API condition code, overriding the dialect operator map for every condition on the column. |
align | "left" | "right" | "center" | Logical header and cell alignment. Numbers default to right. |
groupable | boolean | Makes the field available as a row-group or pivot-row dimension. |
pivotable | boolean | Makes the field available as a pivot column dimension. The column axis takes any number of them. |
aggregable | boolean | Makes a numeric field available as a grid aggregate. A number column is already a chart measure without it. |
chartable | boolean | Set false to keep the column out of the chart's field pickers, for one typed only so it filters — an ID, a reference code. |
dateGranularity | "day" | "instant" | How date values compare. Defaults to day, in the reader's own timezone — “on the 15th” matches every row stamped that day. Use instant when the clock matters. |
defaultAgg | AggFn | Aggregation a measure starts with when it is first dropped into Values. Defaults to sum. May name a function defined in aggFns. |
aggFns | AggFns | This column's own aggregation functions: they win over the grid's aggFns entries of the same name, and a new name here is offered in this column's menus only. |
editable | boolean | Lets the reader change this column's cells — by double-click, Enter, F2 or a keystroke — with the result reported through onCellEdit. Per-row exceptions go through isCellEditable on the grid. |
editor | "text" | "number" | "date" | "select" | "boolean" | ComponentType<CellEditorProps> | Which editor opens. Derived from type — a list once the column has filterOptions or editorOptions — so set it only to override that, or to supply a component of your own. |
editorOptions | FilterOption[] | Choices for the select editor. Defaults to filterOptions. |
parseValue | (text: string) => unknown | Turns typed text into the stored value, replacing the default parse for the column type. |
formatValue | (value: unknown) => string | Formats cells, aggregates, pivots, and chart values consistently. Chart tooltips use it verbatim; axis ticks adopt it only when the result still fits a tick, and fall back to compact notation. |
signed | boolean | Colors non-negative values green and negative values red. |
cellClassName | string | Class applied to every body cell in the column. |
headerClassName | string | Class applied to the column header cell. |
cellStyle | CSSProperties | Inline style applied to every body cell in the column. |
headerIcon | ReactNode | Content rendered in place of the text header label. Sort/pin icons, resize handle, and the filter popover still render around it. |
tooltip | string | Native title text on the header cell. |
options | "visible" | "auto" | null | Shows the header's ⋮ column-options button. Defaults to hidden, since right-clicking the header opens the same menu; "visible" always shows it, "auto" reveals it only while the header is hovered. |
truncate | boolean | Clips content to one line by default; set false for deliberate multi-line cells. |
Imperative grid handle
Attach a React ref when an external command bar needs to drive the grid. Prefer props for normal rendering and state flow.
type ProGridHandle<T> = {
table: Table<T>
getQuery(): GridQuery
refresh(): void
setPage(page: number): void
setPageSize(size: number): void
setSort(sort: SortSpec[]): void
setFilters(filters: ColumnFilter[]): void
setQuickFilter(text: string): void
reset(): void
clearFilters(): void
getState(): ProGridState
resetLayout(): void
expandTree(depth: number | "all"): void
collapseTree(): void
startEdit(rowId: string, columnId: string): boolean
stopEdit(commit?: boolean): void
isEditing(): boolean
getEditedCells(): { rowId: string; columnId: string }[]
clearEditedCells(): void
setPivotMode(on?: boolean): void
setPivotConfig(config: PivotConfig): void
expandPivot(axis: "rows" | "columns", depth: number | "all"): void
exportPivot(options?: { delimiter?: " " | ","; raw?: boolean }): string
exportGrid(options?: GridExportOptions): void
getExportText(options?: GridExportOptions): string
clearPersistedState(): Promise<void>
resetToDefaults(): Promise<void>
captureView(options?: { name?: string; id?: string; parts?: GridViewPart[] }): GridView
applyView(view: GridView | string, options?: ApplyViewOptions): boolean
getViews(): GridView[]
applyTransaction(tx: GridTransaction<T>): GridTransactionResult<T>
applyTransactionAsync(tx: GridTransaction<T>): void
flushTransactions(): void
updateRows(rows: T[]): GridTransactionResult<T>
getRows(): T[]
}Persistence
persist.local / persist.session / persist.slices accept groups, individual slices, or both together (they compose). See Saving layout and filters for what each group covers, what is excluded by default and why, and how to write a custom GridStateAdapter.
type PersistConfig = {
key: string
local?: PersistTarget[] | boolean
session?: PersistTarget[] | boolean
adapter?: GridStateAdapter
slices?: PersistTarget[]
version?: number
migrate?: (stored: unknown, from: { v: number; hv: number }) => StoredGridState | null
debounceMs?: number
onError?: (error: GridPersistError) => void
}
type PersistGroup =
| "columns" | "sort" | "filters" | "group" | "aggregations" | "pagination" | "selection" | "pivot"
type PersistSlice =
| "columnOrder" | "columnVisibility" | "columnSizing" | "columnPinning"
| "sorting" | "columnFilters" | "quickFilter" | "grouping" | "aggregations"
| "pageSize" | "pageIndex" | "rowSelection"
| "pivotConfig" | "pivotExpansion"
type PersistTarget = PersistGroup | PersistSlice
type GridStateAdapter = {
load(key: string): Promise<GridPersistPayload | null> | GridPersistPayload | null
save(key: string, payload: GridPersistPayload): void | Promise<void>
clear?(key: string): void | Promise<void>
}
type GridPersistPayload = {
v: number
hv: number
k: string
t: number
state: StoredGridState
}Saved views
A view carries only the parts it was saved with, and applying it writes only those. See Saved views for layouts that keep the reader’s filters, presets, keeping views in your own store, and building a picker of your own.
type GridViewPart = "columns" | "sort" | "filters" | "group" | "aggregations" | "pivot"
type GridView = {
id: string
name: string
// What applying it writes. Everything else stays as the reader has it.
parts: GridViewPart[]
// The state of exactly those parts; the pivot without its expansion.
state: GridViewState
}
type ApplyViewOptions = {
only?: GridViewPart[] // apply just these of the view's parts
keep?: GridViewPart[] // leave these alone — ["filters"] keeps the reader's
}
type GridViewsConfig = {
// Your own store. Without items the grid keeps them in localStorage.
items?: GridView[]
onChange?: (views: GridView[]) => void
// Code-defined views: applied and copied, never renamed or deleted.
presets?: GridView[]
// Marks a view in the menu; does not apply it.
activeId?: string | null
onActiveChange?: (id: string | null, view: GridView | null) => void
// Unset: a "Keep current filters" switch in the menu. Set: fixed, and hidden.
// Set with onKeepFiltersChange: the switch stays, showing your value.
keepFilters?: boolean
onKeepFiltersChange?: (on: boolean) => void
// Filters outside the grid (a sidebar) that views save and put back with
// theirs, under the "filters" part. value is kept as JSON reads it back.
hostFilters?: {
value: unknown
apply: (value: unknown, view: GridView) => void
equals?: (saved: unknown, now: unknown) => boolean // default: as JSON
}
// Your wording for a part's label or its hint in the save form.
partText?: Partial<Record<GridViewPart, { label?: string; hint?: string }>>
// Ticked in the save form. Defaults to every part this grid has.
defaultParts?: GridViewPart[]
// false: switching only. Defaults to true, except items without onChange.
editable?: boolean
// localStorage["progrid-views:<key>"]. Defaults to persist.key.
storageKey?: string
}
// ctx.views in renderToolbar / renderToolbarEnd / renderFooter.
type GridViewsController = {
views: GridView[]
isPreset(id: string): boolean
active: GridView | null
modified: boolean
keepFilters: boolean
canToggleKeepFilters: boolean
setKeepFilters(on: boolean): void
editable: boolean
// "filters" only where there is something to filter with.
availableParts: GridViewPart[]
partText: Partial<Record<GridViewPart, { label?: string; hint?: string }>>
defaultParts: GridViewPart[]
apply(id: string, options?: ApplyViewOptions): boolean
save(name: string, parts?: GridViewPart[]): GridView | null
update(id: string): void
rename(id: string, name: string): void
remove(id: string): void
clearActive(): void
}Live updates
The transaction methods above are inert until liveUpdates is set, and need a getRowId to match rows on. See Live data and transactions for the full behaviour.
type GridTransaction<T> = {
add?: T[]
addIndex?: number
remove?: (T | string)[]
update?: T[]
}
type GridTransactionResult<T> = {
status: "applied" | "cancelled" | "no-op"
add: T[]
remove: T[]
update: T[]
unmatched: string[]
}
type LiveUpdateConfig<T> = {
enabled?: boolean
batchMillis?: number
flash?: boolean
flashMillis?: number
aggMillis?: number
maxRows?: number
onFlush?: (result: GridTransactionResult<T>) => void
}