# columnDefs

Defines column data fields, headings, sizes, visibility, and editing. Include column groups to create multi-level headers.

Canonical: https://grid.syidax.com/docs/options/columnDefs/

<a id="meaning"></a>

## What does this API do?

Defines column data fields, headings, sizes, visibility, and editing. Include column groups to create multi-level headers.

<a id="contract"></a>

## Exact input and result types

```typescript
columnDefs: Array<ColumnDef | GridColumnGroupDef>
```

| Item | Value |
| --- | --- |
| JavaScript name | columnDefs |
| HTML attribute | column-defs |
| Default | undefined |
| Input type | Array<ColumnDef \| GridColumnGroupDef> |

<a id="usage"></a>

## Usage flow

Set this on a property of the Grid element. Pass arrays, objects, and callbacks through JavaScript, and use new arrays or objects when applying changes.

<a id="types"></a>

## Read related types

- [ColumnDef](https://grid.syidax.com/docs/types/ColumnDef.md)
- [GridColumnGroupDef](https://grid.syidax.com/docs/types/GridColumnGroupDef.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Data updates](https://grid.syidax.com/docs/features/data-updates.md) — Replace rowData when receiving a complete query result. For partial changes, pass add, update, and remove to applyTransaction. Updates match through getRowId, not display positions.
