Skip to contents

It is best to directly view the original document, please see https://www.ag-grid.com/javascript-data-grid/column-properties/.

Usage

ag_col_def(
  x,
  columns = NULL,
  field = NULL,
  colId = NULL,
  type = NULL,
  cellDataType = NULL,
  valueGetter = NULL,
  valueFormatter = NULL,
  refData = NULL,
  keyCreator = NULL,
  equals = NULL,
  checkboxSelection = NULL,
  showDisabledCheckboxes = NULL,
  toolPanelClass = NULL,
  suppressColumnsToolPanel = NULL,
  columnGroupShow = NULL,
  icons = NULL,
  suppressNavigable = NULL,
  suppressKeyboardEvent = NULL,
  suppressPaste = NULL,
  suppressFillHandle = NULL,
  ...
)

Arguments

x

aggrid Object

columns

Specify the column to modify, Default is all columns.

field

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'.

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.

cellDataType

The data type of the cell values for this column. Can either infer the data type from the row data (true - the default behaviour), define a specific data type (string), or have no data type (false). If setting a specific data type (string value), this can either be one of the pre-defined data types 'text', 'number', 'boolean', 'date', 'dateString' or 'object', or a custom data type that has been defined in the dataTypeDefinitions grid option. Data type inference only works for the Client-Side Row Model, and requires non-null data. It will also not work if the valueGetter, valueParser or refData properties are defined, or if this column is a sparkline.

valueGetter

Function or expression. Gets the value from your data for display.

valueFormatter

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.

refData

Provided a reference data map to be used to map column values to their respective value from the map.

keyCreator

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.

equals

Custom comparator for values, used by renderer to know if values have changed. Cells whose values have not changed don't get refreshed. By default the grid uses === which should work for most use cases.

checkboxSelection

Set to true (or return true from function) to render a selection checkbox in the column.

showDisabledCheckboxes

Set to true to display a disabled checkbox when row is not selectable and checkboxes are enabled.

toolPanelClass

CSS 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.

columnGroupShow

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

Icons to use inside the column instead of the grid's default icons. Leave undefined to use defaults.

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.

suppressKeyboardEvent

Allows the user to suppress certain keyboard events in the grid cell.

suppressPaste

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.

suppressFillHandle

Set to true to prevent the fillHandle from being rendered in any cell that belongs to this column.

...

please see https://www.ag-grid.com/javascript-data-grid/column-properties/.

See also