# Templates

There are different ways to attach the templates to the datagrid (depending on the framework). The template named 'cell' will overwrite the default cell template (used for all datagrid cells). Otherwise put the template name into column's template attribute:

const columns = [
    { field: 'customerID', template: 'id-cell' }  
];

It is also possible to set the template dynamically depending on row data - see next section

# Context

You can use the following context fields with your tempalte:

  • text - cell text
  • value - cell value (before formatting)
  • data - row data
  • column - column state
  • row - row state
  • actions - combined row and column actions