ColumnDef
ColumnDef<T> is a discriminated union of DataColumnDef<T> (backed by a row property key) and ComputedColumnDef<T> (computed via colId + valueGetter without key).
DataColumnDef<T> vs ComputedColumnDef<T>
Section titled “DataColumnDef<T> vs ComputedColumnDef<T>”| Property | Kind | Default |
|---|---|---|
key |
Data | — (required on data columns) |
colId |
Both | key (required on computed columns) |
valueGetter |
Both | row[key] |
- Kind: Data · Type:
keyof T & string· Default: — (required on data columns) · Guide: Columns & Layout - Row property name; also used as
colIdunlesscolIdis specified
- Kind: Both · Type:
string· Default:key(required on computed columns) · Guide: Columns & Layout - Unique stable column identifier used by state, sorting, filtering, and spans
valueGetter
Section titled “valueGetter”- Kind: Both · Type:
(params: ValueGetterParams<T>) => unknown· Default:row[key]· Guide: Columns & Layout - Custom value extractor (required on
ComputedColumnDef<T>)
BaseColumnDef<T> Properties
Section titled “BaseColumnDef<T> Properties”Shared defaults can be configured once on GridOptions.defaultColDef and overridden per column:
| Property | Default | Guide |
|---|---|---|
name |
colId |
Columns & Layout |
width |
150 |
Columns & Layout |
minWidth |
40 |
Columns & Layout |
maxWidth |
Infinity |
Columns & Layout |
flex |
null |
Columns & Layout |
pinned |
null |
Columns & Layout |
isVisible |
true |
Columns & Layout |
isMovable |
true |
Columns & Layout |
isResizable |
true |
Columns & Layout |
cellDataType |
'auto' |
Columns & Layout |
isSortable |
false |
Sorting & Filtering |
isFilterable |
false |
Sorting & Filtering |
isEditable |
false |
Selection & Editing |
formatter |
String(value ?? '') |
Columns & Layout |
comparator |
type-aware | Sorting & Filtering |
quickFilterTextGetter |
formattedValue |
Sorting & Filtering |
filterPredicate |
type-aware | Sorting & Filtering |
valueParser |
identity | Selection & Editing |
valueValidator |
() => null |
Selection & Editing |
valueEquals |
Object.is |
Selection & Editing |
valueSetter |
shallow clone [key] |
Selection & Editing |
editor |
undefined |
Selection & Editing |
cellEditor |
built-in | Selection & Editing |
cellRenderer |
text binding | Selection & Editing |
pinnedCellRenderer |
text binding | Selection & Editing |
- Type:
string· Default:colId· Guide: Columns & Layout - Header display label and export header title
- Type:
number· Default:150· Guide: Columns & Layout - Initial column width in px
minWidth
Section titled “minWidth”- Type:
number· Default:40· Guide: Columns & Layout - Minimum allowed width in px during resize, flex, and autosize
maxWidth
Section titled “maxWidth”- Type:
number· Default:Infinity· Guide: Columns & Layout - Maximum allowed width in px during resize, flex, and autosize
- Type:
number | null· Default:null· Guide: Columns & Layout - Proportional share of remaining center viewport width
pinned
Section titled “pinned”- Type:
'start' | 'end' | null· Default:null· Guide: Columns & Layout - Pins the column to the logical start or end edge
isVisible
Section titled “isVisible”- Type:
boolean· Default:true· Guide: Columns & Layout - Initial column visibility
isMovable
Section titled “isMovable”- Type:
boolean· Default:true· Guide: Columns & Layout - Enables drag-reordering of the column
isResizable
Section titled “isResizable”- Type:
boolean· Default:true· Guide: Columns & Layout - Enables pointer drag-resizing via the header handle
cellDataType
Section titled “cellDataType”- Type:
'auto' | 'text' | 'number' | 'boolean' | 'date' | 'dateTime'· Default:'auto'· Guide: Columns & Layout - Drives built-in sorting, filtering, editors, and Excel export cell typing
isSortable
Section titled “isSortable”- Type:
boolean· Default:false· Guide: Sorting & Filtering - Enables header click / Shift+click sorting
isFilterable
Section titled “isFilterable”- Type:
boolean· Default:false· Guide: Sorting & Filtering - Enables
FilterModelfiltering on this column
isEditable
Section titled “isEditable”- Type:
boolean | ((params: CellEditParams<T>) => boolean)· Default:false· Guide: Selection & Editing - Enables cell editing statically or per cell/epoch/origin
formatter
Section titled “formatter”- Type:
(params: ValueFormatterParams<T>) => string· Default:String(value ?? '')· Guide: Columns & Layout - Formats cell value into display text (
textContent)
comparator
Section titled “comparator”- Type:
(params: ComparatorParams<T>) => number· Default: type-aware · Guide: Sorting & Filtering - Custom sort comparator returning
< 0,0, or> 0
quickFilterTextGetter
Section titled “quickFilterTextGetter”- Type:
(params: QuickFilterTextGetterParams<T>) => string· Default:formattedValue· Guide: Sorting & Filtering - Custom searchable text for
setQuickFilter
filterPredicate
Section titled “filterPredicate”- Type:
(params: FilterPredicateParams<T>) => boolean· Default: type-aware · Guide: Sorting & Filtering - Custom predicate for column filter evaluation
valueParser
Section titled “valueParser”- Type:
(params: ValueChangeParams<T>) => unknown· Default: identity · Guide: Selection & Editing - Parses editor/paste input into domain value before validation
valueValidator
Section titled “valueValidator”- Type:
(params: ValueChangeParams<T>) => string | null· Default:() => null· Guide: Selection & Editing - Validates parsed value; return an error string or
nullif valid
valueEquals
Section titled “valueEquals”- Type:
(params: ValueChangeParams<T>) => boolean· Default:Object.is· Guide: Selection & Editing - Skips no-op mutations when old and new values are equal
valueSetter
Section titled “valueSetter”- Type:
(params: ValueChangeParams<T>) => T· Default: shallow clone[key]· Guide: Selection & Editing - Returns a new immutable row
Twith the updated value
editor
Section titled “editor”- Type:
(value: unknown, row: T) => HTMLElement· Default:undefined· Guide: Selection & Editing - Simplified factory returning a detached
<input>,<select>, or<textarea>
cellEditor
Section titled “cellEditor”- Type:
(params: Readonly<CellEditorParams<T>>) => CellEditorInstance· Default: built-in · Guide: Selection & Editing - Full custom editor lifecycle factory
cellRenderer
Section titled “cellRenderer”- Type:
(params: Readonly<CellRendererParams<T>>) => CellRendererInstance<T>· Default: text binding · Guide: Selection & Editing - Custom pooled DOM renderer for body cells
pinnedCellRenderer
Section titled “pinnedCellRenderer”- Type:
(params: Readonly<PinnedCellRendererParams<T>>) => CellRendererInstance<T, PinnedCellRendererParams<T>>· Default: text binding · Guide: Selection & Editing - Custom pooled DOM renderer for top/bottom pinned rows
Callback Parameter Interfaces
Section titled “Callback Parameter Interfaces”Read, Format, Sort & Filter Params
Section titled “Read, Format, Sort & Filter Params”ValueGetterParams<T>:{ data: T, colId: string }ValueFormatterParams<T>: extendsValueGetterParams<T>+{ value: unknown }QuickFilterTextGetterParams<T>: extendsValueFormatterParams<T>+{ formattedValue: string }FilterPredicateParams<T>:{ value: unknown, data: T, colId: string, sourceIndex: number, model: Readonly<ColumnFilterModel> }ComparatorParams<T>:{ valueA: unknown, valueB: unknown, dataA: T, dataB: T, colId: string }
Rendering & Editing Params
Section titled “Rendering & Editing Params”CellRendererParams<T>: extendsValueGetterParams<T>+{ value, formattedValue, sourceIndex, displayIndex, rowId, dataEpoch, document, api }PinnedCellRendererParams<T>: extendsValueGetterParams<T>+{ value, formattedValue, address: Readonly<RegionRowAddress>, document, api }CellEditParams<T>: extendsValueGetterParams<T>+{ rowId, sourceIndex, dataEpoch, origin: ValueChangeOrigin }ValueChangeParams<T>: extendsCellEditParams<T>+{ oldValue: unknown, newValue: unknown }CellEditorParams<T>: extendsCellEditParams<T>+{ value: unknown, document: Document, api: GridApi<T> }