ColDef interface.
Overview
Column properties can be set on individual columns or indefaultColDef to apply to all columns:
Display Properties
The field of the row object to get the cell’s data from. Deep references into a row object is supported via dot notation, i.e
'address.firstLine'.The name to render in the column header. If not specified and field is specified, the field name will be used as the header name.
Set to
true for this column to be hidden.Same as
hide, except only applied when creating a new column. Not applied when updating column definitions.Initial: This property is only used when creating columns.Set to
true to block making column visible / hidden via the UI (API will still work).Width Properties
Initial width in pixels for the cell. If no width or flex properties set, cell width will default to 200 pixels.
Same as
width, except only applied when creating a new column. Not applied when updating column definitions.Initial: This property is only used when creating columns.Minimum width in pixels for the cell.
Maximum width in pixels for the cell.
Equivalent to
flex-grow in CSS. When flex is set on one or more columns, any width value is ignored and instead the remaining free space in the grid is divided among flex columns in proportion to their flex value.Set to
false to disable resizing which is enabled by default.Sorting
Set to
false to disable sorting which is enabled by default.Set the default sort. Can be
'asc', 'desc', or a SortDef object.If sorting more than one column by default, specifies order in which the sorting should be applied.
Override the default sorting order by providing a custom sort comparator.
Set to
true if you want the unsorted icon to be shown when no sort is applied to this column.Filtering
Filter to use for this column. Set to
true to use the default filter. Set to the name of a provided filter or a custom filter component.Params to be passed to the filter component specified in
filter.Whether to display a floating filter for this column.
Pinning
Pin a column to one side:
right or left. A value of true is converted to 'left'.Lock a column to position to
'left' or 'right' to always have this column displayed in that position. true is treated as 'left'.Set to true to block the user pinning the column, the column can only be pinned via definitions or API.
Value Handling
Function or expression. Gets the value from your data for display.
A function or expression to format a value, should return a string.
Function or expression. Sets the value into your data for saving. Return
true if the data changed.Function or expression. Parses the value for saving.
Cell Rendering
Provide your own cell Renderer component for this column’s cells.
Params to be passed to the
cellRenderer component.Cell Editing
Set to
true if this column is editable, otherwise false. Can also be a function to have different rows editable.Provide your own cell editor component for this column’s cells.
Params to be passed to the
cellEditor component.Set to
true to have cells under this column enter edit mode after single click.Styling
Class to use for the cell. Can be string, array of strings, or function that returns a string or array of strings.Module:
CellStyleModuleAn object of CSS values / or function returning an object of CSS values for a particular cell.Module:
CellStyleModuleCSS class to use for the header cell. Can be a string, array of strings, or function.
Type & Data Type
A comma separated string or array of strings containing
ColumnType keys which can be used as a template for a column. This helps to reduce duplication of properties when you have a lot of common column properties.The data type of the cell values for this column. Can either infer the data type from the row data (
true), define a specific data type (string), or have no data type (false).Related APIs
Column Definitions
Complete ColDef interface reference
Column Events
Events fired by column interactions
GridApi
Programmatic column control