Skip to Content

ColDefMui type

Tip

This API reference is automatically generated from the source code  of the @jsoc/react-grid-mui  package.

View Declaration

export type ColDefMui = GridColDef<GridRow>;

Fields

NameTypeDefault
fieldstring

The unique identifier of the column. Used to map with [[GridRowModel]] values.

headerNamestring

The title displayed in the column header cell.

descriptionstring

The tooltip text shown when the column header name is truncated.

widthnumber

The width of the column in pixels.

100
flexnumber

The flex grow factor of the column. Must be a positive number.

minWidthnumber

The minimum width of the column in pixels.

50
maxWidthnumber

The maximum width of the column in pixels.

Infinity
hideableboolean

If false, removes the option to hide this column.

true
sortableboolean

If false, disables sorting for this column.

true
sortingOrderreadonly GridSortDirection[]

The order of the sorting sequence.

resizableboolean

If false, disables resizing for this column.

true
editableboolean

If true, the cells of the column are editable.

false
groupableboolean

If true, the rows can be grouped based on this column values (pro-plan only). Only available in DataGridPremium. TODO: Use module augmentation to move it to @mui/x-data-grid-premium (need to modify how we handle column types default values).

true
pinnableboolean

If false, the menu items for column pinning menu will not be rendered. Only available in DataGridPro. TODO: Use module augmentation to move it to @mui/x-data-grid-pro (need to modify how we handle column types default values).

true
sortComparatorGridComparatorFn<any>

A comparator function used to sort rows.

getSortComparator(sortDirection: GridSortDirection) => GridComparatorFn<any> | undefined

Provide an alternative comparator function for sorting. Takes precedence over sortComparator.

typeGridColType

The type of the column.

'string' 'actions' 'singleSelect'
alignGridAlignment

Align cell content.

valueGetterGridValueGetter<UJSONObject, any, any, never>

Function that returns specific data to render in the cell instead of using the field value.

rowSpanValueGetterGridValueGetter<UJSONObject, any, any, never>

Function that returns a specific value to be used in row spanning.

valueSetterGridValueSetter<UJSONObject, any, any>

Function that customizes how the entered value is stored in the row. Only works with cell/row editing.

valueFormatterGridValueFormatter<UJSONObject, any, any, never>

Formats the cell value before rendering.

valueParserGridValueParser<UJSONObject, any, any>

Function that takes the user-entered value and converts it to a value used internally.

cellClassNameGridCellClassNamePropType<UJSONObject, any>

Class name added to cells in this column.

display"text" | "flex"

Display mode for the cell:

  • ‘text’: For text-based cells (default)
  • ‘flex’: For cells with HTMLElement children
renderCell(params: GridRenderCellParams<UJSONObject, any, any, GridTreeNodeWithRender>) => ReactNode

Override the component rendered as cell for this column.

renderEditCell(params: GridRenderEditCellParams<UJSONObject, any, any, GridTreeNodeWithRender>) => ReactNode

Override the component rendered in edit cell mode for this column.

preProcessEditCellProps(params: GridPreProcessEditCellProps<any, any>) => GridEditCellProps<any> | Promise<GridEditCellProps<any>>

Callback fired when the edit props of the cell changes. Processes the props before being saved into the state.

headerClassNameGridColumnHeaderClassNamePropType

Class name added to the column header cell.

renderHeader(params: GridColumnHeaderParams<UJSONObject, any, any>) => ReactNode

Override the component rendered in the column header cell.

headerAlignGridAlignment

Align column header content.

hideSortIconsboolean

Toggle the visibility of the sort icons.

false
disableColumnMenuboolean

If true, the column menu is disabled for this column.

false
filterableboolean

If true, the column is filterable.

true
filterOperatorsreadonly GridFilterOperator<UJSONObject, any, any, any>[]

Allows setting the filter operators for this column.

getApplyQuickFilterFnGetApplyQuickFilterFn<UJSONObject, any>

The callback that generates a filtering function for a given quick filter value. This function can return null to skip filtering for this value and column.

disableReorderboolean

If true, this column cannot be reordered.

false
disableExportboolean

If true, this column will not be included in exports.

false
colSpannumber | GridColSpanFn<UJSONObject, any, any>

Number of columns a cell should span.

1
examplesany[]

Example values that can be used by the grid to get more context about the column.