Vue Data Grid: Column 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.
Columns
fieldstring | The field of the row to get the cells data from. | |
colIdstring | 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. | |
typestring | string[] | 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. | |
valueGetterstring | ValueGetterFunc | Function or expression. Gets the value from your data for display. See Value Getters. | |
valueFormatterstring | ValueFormatterFunc | Function or expression. Formats the value for display. See Value Formatters. | |
keyCreatorFunction | 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. | |
tooltipFieldstring | The field of the tooltip to apply to the cell. | |
tooltipValueGetterFunction | Callback that should return the string used for a tooltip. | |
checkboxSelectionboolean | CheckboxSelectionCallback | boolean or Function. Set to true (or return true from function) to render a selection checkbox in the column.Default: false | |
toolPanelClassToolPanelClass | Class to use for the tool panel cell. Can be a string, array of strings, or function. | |
suppressColumnsToolPanelboolean | Set to true if you do not want this column or group to appear in the Columns Tool Panel.Default: false | |
columnGroupShowstring | Whether to show the column when the group is open / closed. | |
chartDataType'category' | 'series' | 'time' | 'excluded' | Defines the chart data type that should be used for a column. | |
icons{ [key: string]: Function | string; } | Icons to use inside the column instead of the grid's default icons. See Custom Icons. | |
suppressNavigableboolean | SuppressNavigableCallback | 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 | |
suppressKeyboardEventFunction | Suppress the grid taking action for the relevant keyboard event when a cell is focused. See Suppress Keyboard Events. Default: false | |
suppressPasteboolean | SuppressPasteCallback | 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. |
Columns: Header
headerNamestring | 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. | |
headerValueGetterstring | Function | Function or expression. Gets the value for display in the header. | |
headerTooltipstring | Tooltip for the column header | |
headerClassHeaderClass | Class to use for the header cell. Can be a string, array of strings, or function. | |
headerComponent | Header component to use for this column. See Header Component. | |
headerComponentParamsany | Params to be passed to header component. | |
menuTabsstring[] | 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. | |
columnsMenuParamsColumnsMenuParams | Params used to change the behaviour and appearance of the Columns Menu tab. See Customising the Columns Menu Tab. | |
suppressMenuboolean | Set to true if no menu should be shown for this column header.Default: false | |
suppressHeaderKeyboardEventFunction | Suppress the grid taking action for the relevant keyboard event when a header is focused. See Suppress Keyboard Events. Default: false | |
headerCheckboxSelectionboolean | HeaderCheckboxSelectionCallback | If true or the callback returns true, a 'select all' checkbox will be put into the header. See Header Checkbox Selection. | |
headerCheckboxSelectionFilteredOnlyboolean | If true, the header checkbox selection will only select filtered items. See Select Everything or Just Filtered. |
Columns: Display
hideboolean | Set to true for this column to be hidden. You might think it would make more sense to call this field visible and mark it false to hide, but we want all default values to be false and we want columns to be visible by default.Default: false | |
initialHideboolean | Same as 'hide', except only applied when creating a new column. Not applied when updating column definitions. | |
lockVisibleboolean | Set to true to block making column visible / hidden via the UI (API will still work).Default: false | |
lockPositionboolean | Set to true to always have this column displayed first.Default: false | |
suppressMovableboolean | Set to true if you do not want this column to be movable via dragging.Default: false |
Columns: Width
widthnumber | Initial width in pixels for the cell. | |
initialWidthnumber | Same as 'width', except only applied when creating a new column. Not applied when updating column definitions. | |
minWidthnumber | Minimum width in pixels for the cell. | |
maxWidthnumber | Maximum width in pixels for the cell. | |
flexnumber | Used instead of width when the goal is to fill the remaining empty space of the grid. See Column Flex. | |
initialFlexnumber | Same as 'flex', except only applied when creating a new column. Not applied when updating column definitions. | |
resizableboolean | Set to true to allow column to be resized.Default: false | |
suppressSizeToFitboolean | Set to true if you want this column's width to be fixed during 'size to fit' operations.Default: false |
Columns: Pinned
pinnedboolean | string | null | Pin a column to one side. A value of true is converted to 'left'Options: 'left', 'right' | |
initialPinnedboolean | string | Same as 'pinned', except only applied when creating a new column. Not applied when updating column definitions. | |
lockPinnedboolean | Set to true to block pinning column via the UI (API will still work).Default: false |
Columns: Spanning
colSpanFunction | By default, each cell will take up the width of one column. You can change this behaviour to allow cells to span multiple columns. | |
rowSpanFunction | 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: Rendering and Styling
cellStyle{ [cssProperty: string]: string } | CellStyleFunc | The style to give a particular cell. See Cell Style. | |
cellClassstring | string[] | CellClassFunc | The class to give a particular cell. See Cell Class. | |
cellClassRulesCellClassRules | Rules which can be applied to include certain CSS classes. See Cell Class Rules. | |
cellRenderer | cellRenderer to use for this column. See Cell Renderer. | |
cellRendererParamsany | Params to be passed to cell renderer component. See Cell Renderer Params. | |
cellRendererSelectorFunction | Callback to select which cell renderer to be used for a given row within the same column. See Many Renderers One Column. | |
autoHeightboolean | Set to true to have the grid calculate the height of a row based on contents of this column.Default: false | |
wrapTextboolean | Set to true to have the text wrap inside the cell.Default: false | |
enableCellChangeFlashboolean | Set to true to flash a cell when it's refreshed.Default: false | |
suppressCellFlashboolean | 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: Sort
sortableboolean | Set to true to allow sorting on this column.Default: false | |
sortstring | null | Set to sort this column. Options: null, 'asc', 'desc' | |
initialSortstring | Same as sort, except only applied when creating a new column. Not applied when updating column definitions. | |
sortIndexnumber | null | If doing multi-sort by default, the order which column sorts are applied. | |
initialSortIndexnumber | Same as 'sortIndex', except only applied when creating a new column. Not applied when updating column definitions. | |
sortingOrder(string | null)[] | Array defining the order in which sorting occurs (if sorting is enabled). Options: null, 'asc', 'desc' | |
comparatorFunction | Comparator function for custom sorting. | |
unSortIconboolean | Set to true if you want the unsorted icon to be shown when no sort is applied to this column.Default: false |
Columns: Filter
filterIFilterType | 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 Configuring Filters. | |
filterValueGetterstring | ValueGetterFunc | Function or expression. Gets the value for filtering purposes. | |
getQuickFilterTextFunction | 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). | |
filterFrameworkany | Provided a custom framework filter to use for this column. See Custom Filter. | |
filterParamsany | Custom params to be passed to the filter component specified in filter or filterFramework. See Filter Parameters. | |
floatingFilterboolean | Whether to show a floating filter for this column. See Floating Filter. Default: false | |
floatingFilterComponentIFloatingFilterType | Floating filter component to use for this column. See Floating Filter Component. | |
floatingFilterComponentFrameworkany | Floating filter framework component to use for this column. See Floating Filter Component. | |
floatingFilterComponentParamsany | Custom params to be passed to floatingFilterComponent or floatingFilterComponentFramework. See Floating Filter Parameters. | |
suppressFiltersToolPanelboolean | 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: Editing
editableboolean | EditableCallback | Set to true if this column is editable, otherwise false. Can also be a function to have different rows editable.Default: false | |
valueSetterstring | ValueSetterFunc | Function or expression. Sets the value into your data for saving. Return true if the data changed. | |
valueParserstring | ValueParserFunc | Function or expression. Parses the value for saving. | |
cellEditor | cellEditor to use for this column. See Cell Editors. | |
cellEditorParamsany | Params to be passed to cell editor component. | |
cellEditorSelectorFunction | Callback to select which cell editor to be used for a given row within the same column. See Many Editors One Column. | |
singleClickEditboolean | Set to true to have cells under this column enter edit mode after single click.Default: false |
Columns: Row Grouping
(Enterprise only) See Row Grouping
rowGroupboolean | Set to true to row group by this column | |
initialRowGroupboolean | Same as 'rowGroup', except only applied when creating a new column. Not applied when updating column definitions. | |
rowGroupIndexnumber | null | 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). | |
initialRowGroupIndexnumber | Same as 'rowGroupIndex', except only applied when creating a new column. Not applied when updating column definitions. | |
enableRowGroupboolean | (Enterprise only) 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 | |
enableValueboolean | (Enterprise only) 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 | |
aggFuncstring | IAggFunc | null | Name of function to use for aggregation. You can also provide your own agg function. Options: 'sum', 'min', 'max', 'first', 'last' | |
initialAggFuncstring | IAggFunc | Same as 'aggFunc', except only applied when creating a new column. Not applied when updating column definitions. | |
allowedAggFuncsstring[] | 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. |
Columns: Pivoting
(Enterprise only) See Pivoting
pivotboolean | Set to true to pivot by this column | |
initialPivotboolean | Same as 'pivot', except only applied when creating a new column. Not applied when updating column definitions. | |
pivotIndexnumber | null | Set this in columns you want to pivot by. If only pivoting by one column, set this to any number (e.g. 0). If pivoting by multiple columns, set this to where you want this column to be in the order of pivots (e.g. 0 for first, 1 for second, and so on). | |
initialPivotIndexnumber | Same as 'pivotIndex', except only applied when creating a new column. Not applied when updating column definitions. | |
pivotComparatorFunction | Comparator to use when ordering the pivot columns, when this column is used to pivot on. The values will always be strings, as the pivot service uses strings as keys for the pivot groups. | |
enablePivotboolean | Set to true if you want to be able to pivot by this column via the GUI. This will not block the API or properties being used to achieve pivot.Default: false |
Columns: Row Dragging
See Row Dragging
rowDragboolean | RowDragCallback | boolean or Function. Set to true (or return true from function) to allow row dragging.Default: false | |
rowDragTextFunction | A callback that should return a string to be displayed by the rowDragComp while dragging a row. If this callback is not set, the current cell value will be used. | |
dndSourceboolean | DndSourceCallback | boolean or Function. Set to true (or return true from function) to allow dragging for native drag and drop.Default: false | |
dndSourceOnRowDragFunction | Function to allow custom drag functionality for native drag and drop. |
Columns: Events
onCellValueChangedNewValueParams | Callback for after the value of a cell has changed, either due to editing or the application calling api.setValue(). | |
onCellClickedCellClickedEvent | Callback called when a cell is clicked. | |
onCellDoubleClickedCellDoubleClickedEvent | Callback called when a cell is double clicked. | |
onCellContextMenuCellContextMenuEvent | Callback called when a cell is right clicked. |
Groups
For column groups, the property children is mandatory. When the grid sees children it knows it's a column group.
children *(ColDef | ColGroupDef)[] | A list containing a mix of columns and column groups. | |
groupIdstring | 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. | |
marryChildrenboolean | 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 | |
openByDefaultboolean | Set to true if this group should be opened by default.Default: false | |
columnGroupShowstring | Whether to show the column when the group is open / closed. | |
toolPanelClassToolPanelClass | Class to use for the tool panel cell. Can be a string, array of strings, or function. | |
suppressColumnsToolPanelboolean | Set to true if you do not want this column or group to appear in the Columns Tool Panel.Default: false | |
suppressFiltersToolPanelboolean | Set to true if you do not want this column (filter) or group (filter group) to appear in the Filters Tool Panel.Default: false |
Groups: Header
headerNamestring | 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. | |
headerClassHeaderClass | Class to use for the header cell. Can be a string, array of strings, or function. | |
headerGroupComponent | Component to use header group. | |
headerGroupComponentParamsany | Params for the header group component. |