JavaScript Data GridColumn Properties
Properties are available for columns ColDef
and column groups ColGroupDef
. For column groups, the property children
is mandatory. When the grid sees children
it knows it's a column group.
Typescript supports a generic row data type via ColDef<TData>
and ColDefGroup<TData>
. If not set TData
defaults to any
. See Typescript Generics for more details.
Columns
| 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' .
See Accessing Row Data Values. | |
| The unique ID to give the column. This is optional. If missing, the ID will default to the field. If both field and colId are missing, a unique ID will be generated. This ID is used to identify the column in the API for sorting, filtering etc. | |
| 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.
See Column Types. | |
| Function or expression. Gets the value from your data for display. See Value Getters.
| |
| A function or expression to format a value, should return a string. Not used for CSV export or copy to clipboard, only for UI cell rendering. See Value Formatters.
| |
| Provided a reference data map to be used to map column values to their respective value from the map. See Using the 'refData' Property. | |
| Function to return a string key for a value. This string is used for grouping, Set filtering, and searching within cell editor dropdowns. When filtering and searching the string is exposed to the user, so make sure to return a human-readable value.
| |
| Custom comparator for values, used by renderer to know if values have changed. Cells who's values have not changed don't get refreshed. By default the grid uses === is used which should work for most use cases.
See Change Detection Comparing Values.
| |
| Set to true (or return true from function) to render a selection checkbox in the column.Default: false
| |
| Set to true to display a disabled checkbox when row is not selectable and checkboxes are enabled.Default: false | |
| CSS class to use for the tool panel cell. Can be a string, array of strings, or function.
| |
| Set to true if you do not want this column or group to appear in the Columns Tool Panel.Default: false | |
| Whether to only show the column when the group is open / closed. If not set the column is always displayed as part of the group.
| |
| Icons to use inside the column instead of the grid's default icons. Leave undefined to use defaults. See Custom Icons. | |
| Set to true if this column is not navigable (i.e. cannot be tabbed into), otherwise false . Can also be a callback function to have different rows navigable.Default: false
| |
| Allows the user to suppress certain keyboard events in the grid cell. See Suppress Keyboard Events. Default: false
| |
| Pasting is on by default as long as cells are editable (non-editable cells cannot be modified, even with a paste operation). Set to true turn paste operations off.
| |
| Set to true to prevent the fillHandle from being rendered in any cell that belongs to this column See Suppressing the Fill Handle. |
Columns: Display
Columns: Editing
See Cell Editing for more information.
| Set to true if this column is editable, otherwise false . Can also be a function to have different rows editable.Default: false
| |
| Function or expression. Custom function to modify your data based off the new value for saving. Return true if the data changed. See Saving Values.
| |
| Function or expression. Parses the value for saving. See Parsing Values.
| |
| Provide your own cell editor component for this column's cells. See Cell Editors. | |
| Params to be passed to the cellEditor component. | |
| Callback to select which cell editor to be used for a given row within the same column. See Many Editors One Column.
| |
| Set to true , to have the cell editor appear in a popup.
| |
| Set the position for the popup cell editor. Possible values are over Popup will be positioned over the cell under Popup will be positioned below the cell leaving the cell value visible. Default: over . | |
| Set to true to have cells under this column enter edit mode after single click.Default: false |
Columns: Events
| Callback for after the value of a cell has changed, either due to editing or the application calling api.setValue() .
| |
| Callback called when a cell is clicked.
| |
| Callback called when a cell is double clicked.
| |
| Callback called when a cell is right clicked.
|
Columns: Filter
See Filtering for more information.
| Filter component to use for this column. Set to true to use the default filter. Set to the name of a Provided Filter or set to a IFilterComp . See Column Filters. | |
| Params to be passed to the filter component specified in filter or filterFramework . See Filter Parameters. | |
| Function or expression. Gets the value for filtering purposes.
| |
| A function to tell the grid what Quick Filter text to use for this column if you don't want to use the default (which is calling toString on the value). See Overriding the Quick Filter Value.
| |
| ||
| The custom component to be used for rendering the floating filter. If none is specified the default AG Grid is used.
See Floating Filter Component. | |
| Params to be passed to floatingFilterComponent or floatingFilterComponentFramework . See Floating Filter Parameters. | |
| Set to true if you do not want this column (filter) or group (filter group) to appear in the Filters Tool Panel.Default: false |
Columns: Header
See Column Headers for more information.
| 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. | |
| Function or expression. Gets the value for display in the header.
| |
| Tooltip for the column header | |
| CSS class to use for the header cell. Can be a string, array of strings, or function.
| |
| The custom header group component to be used for rendering the component header. If none specified the default AG Grid is used. See Header Component. | |
| The parameters to be passed to the headerComponent . | |
| If enabled then column header names that are too long for the column width will wrap onto the next line. Default false | |
| If enabled then the column header row will automatically adjust height to accommodate the size of the header cell. This can be useful when using your own headerComponent or long header names in conjunction with wrapHeaderText . See Auto Header Height.Default: false
| |
| Set to an array containing zero, one or many of the following options: 'filterMenuTab' | 'generalMenuTab' | 'columnsMenuTab' . This is used to figure out which menu tabs are present and in which order the tabs are shown.
| |
| Params used to change the behaviour and appearance of the Columns Menu tab. See Customising the Columns Menu Tab.
| |
| Set to true if no menu should be shown for this column header.Default: false | |
| Suppress the grid taking action for the relevant keyboard event when a header is focused. See Suppress Keyboard Events.
| |
| If true or the callback returns true , a 'select all' checkbox will be put into the header. See Header Checkbox Selection.
| |
| If true , the header checkbox selection will only select filtered items. See Select Everything or Just Filtered. | |
| If true , the header checkbox selection will only select nodes on the current page. See Select Everything on the Current Page. |
Columns: Integrated Charts
(Enterprise only) See Integrated Charts
| Defines the chart data type that should be used for a column. |
Columns: Pinned
See Column Pinning for more information.
Columns: Pivoting
(Enterprise only) See Pivoting
Columns: Rendering and Styling
| An object of css values / or function returning an object of css values for a particular cell. See Cell Style.
| |
| Class to use for the cell. Can be string, array of strings, or function that returns a string or array of strings. See Cell Class.
| |
| Rules which can be applied to include certain CSS classes. See Cell Class Rules.
| |
| Provide your own cell Renderer component for this column's cells. See Cell Renderer. | |
| Params to be passed to the cellRenderer component. See Cell Renderer Params. | |
| Callback to select which cell renderer to be used for a given row within the same column. See Many Renderers One Column.
| |
| Set to true to have the grid calculate the height of a row based on contents of this column.Default: false | |
| Set to true to have the text wrap inside the cell - typically used with autoHeight .Default: false | |
| Set to true to flash a cell when it's refreshed.Default: false | |
| Set to true to prevent this column from flashing on changes. Only applicable if cell flashing is turned on for the grid.Default: false |
Columns: Row Dragging
See Row Dragging for more information.
| boolean or Function . Set to true (or return true from function) to allow row dragging.Default: false
| |
| A callback that should return a string to be displayed by the rowDragComp while dragging a row. If this callback is not set, the rowDragText callback in the gridOptions will be used and if there is no callback in the gridOptions the current cell value will be used.
| |
| boolean or Function . Set to true (or return true from function) to allow dragging for native drag and drop.Default: false
| |
| Function to allow custom drag functionality for native drag and drop.
|
Columns: Row Grouping
(Enterprise only) See Row Grouping
| Set to true to row group by this column.Default: false | |
| Same as rowGroup , except only applied when creating a new column. Not applied when updating column definitions. | |
| Set this in columns you want to group by. If only grouping by one column, set this to any number (e.g. 0 ). If grouping by multiple columns, set this to where you want this column to be in the group (e.g. 0 for first, 1 for second, and so on).
| |
| Same as rowGroupIndex , except only applied when creating a new column. Not applied when updating column definitions. | |
| Set to true if you want to be able to row group by this column via the GUI. This will not block the API or properties being used to achieve row grouping.Default: false
| |
| Set to true to have the grid place the values for the group into the cell, or put the name of a grouped column to just show that group. See Custom Group Columns. | |
| Set to true if you want to be able to aggregate by this column via the GUI. This will not block the API or properties being used to achieve aggregation.Default: false
| |
| Name of function to use for aggregation. In-built options are: sum , min , max , count , avg , first , last . Also accepts a custom aggregation name or an aggregation function.
| |
| Same as aggFunc , except only applied when creating a new column. Not applied when updating column definitions.
| |
| Aggregation functions allowed on this column e.g. ['sum', 'avg'] . If missing, all installed functions are allowed. This will only restrict what the GUI allows a user to select, it does not impact when you set a function via the API. | |
| The name of the aggregation function to use for this column when it is enabled via the GUI. Note that this does not immediately apply the aggregation function like aggFunc Default: sum
|
Columns: Sort
See Row Sorting for more information.
Columns: Spanning
| By default, each cell will take up the width of one column. You can change this behaviour to allow cells to span multiple columns.
| |
| By default, each cell will take up the height of one row. You can change this behaviour to allow cells to span multiple rows.
|
Columns: Tooltips
| The field of the tooltip to apply to the cell. | |
| Callback that should return the string to use for a tooltip, tooltipField takes precedence if set. If using a custom tooltipComponent you may return any custom value to be passed to your tooltip component.
See Tooltip Component.
| |
| Provide your own tooltip component for the column. See Tooltip Component. | |
| The params used to configure tooltipComponent . |
Columns: Width
See Column Sizing for more information.
| Initial width in pixels for the cell. | |
| Same as width , except only applied when creating a new column. Not applied when updating column definitions. | |
| Minimum width in pixels for the cell. | |
| Maximum width in pixels for the cell. | |
| Used instead of width when the goal is to fill the remaining empty space of the grid. See Column Flex. | |
| Same as flex , except only applied when creating a new column. Not applied when updating column definitions. | |
| Set to true to allow this column should be resized.Default: false | |
| Set to true if you want this column's width to be fixed during 'size to fit' operations.Default: false | |
| Set to true if you do not want this column to be auto-resizable by double clicking it's edge.Default: false |
Groups
For column groups, the property children
is mandatory. When the grid sees children
it knows it's a column group.
See Column Groups for more information.
| A list containing a mix of columns and column groups. | |
| The unique ID to give the column. This is optional. If missing, a unique ID will be generated. This ID is used to identify the column group in the column API. | |
| Set to true to keep columns in this group beside each other in the grid. Moving the columns outside of the group (and hence breaking the group) is not allowed.Default: false | |
| If true the label of the Column Group will scroll alongside the grid to always remain visible.Default: false
| |
| Set to true if this group should be opened by default.Default: false | |
| Whether to only show the column when the group is open / closed. If not set the column is always displayed as part of the group.
| |
| CSS class to use for the tool panel cell. Can be a string, array of strings, or function.
| |
| Set to true if you do not want this column or group to appear in the Columns Tool Panel.Default: false | |
| Set to true if you do not want this column (filter) or group (filter group) to appear in the Filters Tool Panel.Default: false | |
| Set to true if you want this column header for this column to span the whole height of the header container.Default: false | |
| Provide your own tooltip component for the column group. See Tooltip Component. | |
| The params used to configure tooltipComponent . |
Groups: Header
See Column Headers for more information.
| 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. | |
| CSS class to use for the header cell. Can be a string, array of strings, or function.
| |
| Tooltip for the column header | |
| The custom header group component to be used for rendering the component header. If none specified the default AG Grid is used. See Header Group Component. | |
| The params used to configure the headerGroupComponent . |