LiveLoveApp logo

Provided Cell Editors

AG Grid Provided Cell Editors

AG Grid provides the following cell editors:

  • Text editor
  • Large text editor
  • Date editor
  • Select editor
  • Rich select editor (enterprise only)
  • The text cell editor is the default.
  • Use the cellEditor column definition property to specify a provided or custom cell editor.

We can specify the provided large text cell editor.

export class GridComponent {
  columnDefs = [
    {
      headerName: 'Account No',
      field: 'account.accountNumber',
      editable: true,
      cellEditor: 'agLargeTextCellEditor'
    },
  ] as ColDef<RowData>[];
}

We can specify the provided select cell editor editor.

export class GridComponent {
  columnDefs = [
    {
      headerName: 'Account No',
      field: 'account.accountNumber',
      editable: true,
      cellEditor: 'agSelectCellEditor'
    },
  ] as ColDef<RowData>[];
}

Exercise

  1. Open the exercise on Stackblitz.
  2. Enable cell editing for the Customer Name column.
  3. Enable cell editing for the Account No column and use the agLargeTextCellEditor.

Solution

export class GridComponent {
  columnDefs = [
    {
      headerName: 'Customer Name',
      field: 'customer.name',
      editable: true,
    },
    {
      headerName: 'Account No',
      field: 'account.accountNumber',
      editable: true,
      cellEditor: 'agLargeTextCellEditor',
    }
  ] as ColDef<RowData>[];
}

See solution on Stackblitz