Angular Grid: Column Properties
For column groups, the property children
is mandatory. When the grid sees children
it knows it's a column group.
Columns and Column Groups
headerName | 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. |
columnGroupShow | Whether to show the column when the group is open / closed. |
headerClass | Class to use for the header cell. Can be a string, array of strings, or function. |
toolPanelClass | Class to use for the tool panel cell. Can be a string, array of strings, or function. |
suppressColumnsToolPanel | Set to true if you do not want this column or group to appear in the Columns Tool Panel.Default: false |
suppressFiltersToolPanel | 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 Only
field | The field of the row to get the cells data from. |
colId | 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. |
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. |
width | Initial width in pixels for the cell. |
defaultWidth | Same as 'width', except only applied when creating a new column. Not applied when updating column definitions. |
minWidth | Minimum width in pixels for the cell. |
maxWidth | Maximum width in pixels for the cell. |
flex | Used instead of width when the goal is to fill the remaining empty space of the grid. See Column Flex. |
initialFlex | Same as 'flex', except only applied when creating a new column. Not applied when updating column definitions. |
filter | Filter component to use for this column. Set to true to use the default filter. |
filterParams | Custom params to be passed to filter component. |
floatingFilter | Whether to show a floating filter for this column. Default: false |
floatingFilterComponent | Floating filter component to use for this column. |
floatingFilterComponentParams | Custom params to be passed to floatingFilterComponent or floatingFilterComponentFramework . |
hide | 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 |
initialHide | Same as 'hide', except only applied when creating a new column. Not applied when updating column definitions. |
pinned | Pin a column to one side. Options: 'left' , 'right' |
initialPinned | Same as 'pinned', except only applied when creating a new column. Not applied when updating column definitions. |
lockPosition | Set to true to always have this column displayed first.Default: false |
lockVisible | Set to true to block making column visible / hidden via the UI (API will still work).Default: false |
lockPinned | Set to true to block pinning column via the UI (API will still work).Default: false |
sortable | Set to true to allow sorting on this column.Default: false |
sort | Set to sort this column. Options: null , 'asc' , 'desc' |
initialSort | Same as 'sort', except only applied when creating a new column. Not applied when updating column definitions. |
sortIndex | If doing multi-sort by default, the order which column sorts are applied. |
initialSortIndex | Same as 'sortIndex', except only applied when creating a new column. Not applied when updating column definitions. |
sortingOrder | Array defining the order in which sorting occurs (if sorting is enabled). Options: null , 'asc' , 'desc' |
resizable | Set to true to allow column to be resized.Default: false |
headerTooltip | Tooltip for the column header |
tooltipField | The field of the tooltip to apply to the cell. |
tooltipValueGetter | Callback that should return the string used for a tooltip.
|
checkboxSelection | boolean or Function . Set to true (or return true from function) to render a selection checkbox in the column.Default: false |
rowDrag | boolean or Function . Set to true (or return true from function) to allow row dragging.Default: false |
rowDragText | 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.
|
dndSource | boolean or Function . Set to true (or return true from function) to allow dragging for native drag and drop.Default: false |
dndSourceOnRowDrag | Function to allow custom drag functionality for native drag and drop. |
cellStyle | The style to give a particular cell. See Cell Style. |
cellClass | The class to give a particular cell. See Cell Class. |
cellClassRules | Rules which can be applied to include certain CSS classes. See Cell Class Rules. |
editable | Set to true if this column is editable, otherwise false . Can also be a function to have different rows editable.Default: false |
onCellValueChanged(params) | Callback for after the value of a cell has changed, either due to editing or the application calling api.setValue() . |
cellRenderer | cellRenderer to use for this column. |
cellRendererParams | Params to be passed to cell renderer component. |
pinnedRowCellRenderer | cellRenderer to use for pinned rows in this column. Pinned cells will use pinnedCellRenderer if available, or cellRenderer if not. |
pinnedRowCellRendererParams | Params to be passed to pinned row cell renderer component. |
cellRendererSelector | Callback to select which cell renderer / cell editor to be used for a given row within the same column. |
cellEditor | cellEditor to use for this column. |
cellEditorParams | Params to be passed to cell editor component. |
headerComponent | Header component to use for this column. |
headerComponentParams | Params to be passed to header component. |
valueGetter(params) | Function or expression. Gets the value from your data for display. |
headerValueGetter(params) | Function or expression. Gets the value for display in the header. |
filterValueGetter(params) | Function or expression. Gets the value for filtering purposes. |
valueFormatter(params) | Function or expression. Formats the value for display. |
pinnedRowValueFormatter(params) | Function or expression. Formatter to use for a pinned row. If missing, the normal valueFormatter will be used. |
valueSetter(params) | Function or expression. Sets the value into your data for saving. Return true if the data changed. |
valueParser(params) | Function or expression. Parses the value for saving. |
keyCreator(params) | 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. |
getQuickFilterText | 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). |
aggFunc | Name of function to use for aggregation. You can also provide your own agg function. Options: 'sum' , 'min' , 'max' , 'first' , 'last' |
initialAggFunc | Same as 'aggFunc', except only applied when creating a new column. Not applied when updating column definitions. |
allowedAggFuncs | 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. |
rowGroup | Set to true to row group by this column |
initialRowGroup | Same as 'rowGroup', except only applied when creating a new column. Not applied when updating column definitions. |
rowGroupIndex | 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). |
initialRowGroupIndex | Same as 'rowGroupIndex', except only applied when creating a new column. Not applied when updating column definitions. |
pivot | Set to true to pivot by this column |
initialPivot | Same as 'pivot', except only applied when creating a new column. Not applied when updating column definitions. |
pivotIndex | 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). |
initialPivotIndex | Same as 'pivotIndex', except only applied when creating a new column. Not applied when updating column definitions. |
comparator(valueA, valueB, nodeA, nodeB, isInverted) | Comparator function for custom sorting. |
pivotComparator(valueA, valueB) | 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. |
unSortIcon | Set to true if you want the unsorted icon to be shown when no sort is applied to this column.Default: false |
enableRowGroup | (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 |
enablePivot | (Enterprise only) 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 |
enableValue | (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 |
enableCellChangeFlash | Set to true to flash a cell when it's refreshed.Default: false |
menuTabs | 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. |
suppressMenu | Set to true if no menu should be shown for this column header.Default: false |
suppressSizeToFit | Set to true if you want this column's width to be fixed during 'size to fit' operations.Default: false |
suppressMovable | Set to true if you do not want this column to be movable via dragging.Default: false |
suppressNavigable | 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 |
suppressCellFlash | Set to true to prevent this column from flashing on changes. Only applicable if cell flashing is turned on for the grid.Default: false |
suppressHeaderKeyboardEvent(params) | Suppress the grid taking action for the relevant keyboard event when a header is focused. See Suppress Keyboard Events. Default: false |
suppressKeyboardEvent(params) | Suppress the grid taking action for the relevant keyboard event when a cell is focused. See Suppress Keyboard Events. Default: false |
onCellClicked(params) | Callback called when a cell is clicked. |
onCellDoubleClicked(params) | Callback called when a cell is double clicked. |
onCellContextMenu(params) | Callback called when a cell is right clicked. |
autoHeight | Set to true to have the grid calculate the height of a row based on contents of this column.Default: false |
wrapText | Set to true to have the text wrap inside the cell.Default: false |
singleClickEdit | Set to true to have cells under this column enter edit mode after single click.Default: false |
chartDataType | Defines the chart data type that should be used for a column. Options: 'category' , 'series' , 'excluded' |
columnsMenuParams | Params used to change the behaviour and appearance of the Columns Menu tab. See Customising the Columns Menu Tab. |
Column Groups Only
groupId | 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. |
children | A list containing a mix of columns and column groups. |
marryChildren | 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 |
openByDefault | Set to true if this group should be opened by default.Default: false |
headerGroupComponent | Component to use header group. |
headerGroupComponentParams | Params for the header group component. |