Formatting based on cell type

Tags: #<Tag:0x00007efc6df19aa8> #<Tag:0x00007efc6df19710>

What would be the best way to format a cell based on its type (different color if its dropdown or formula vs raw data)? Is there a way to get the cell type in the cell renderer?

Hi @mariothomas

Formula is not a type of the cell, but then you could just use getDataAtCell(row, column).slice(0, 1) === "=" to specify that a cell value starts with =. All the cell types are defined in cel meta, so you can access then by getCellMeta(row, column).type or within a cell renderer from the last argument with cell properties

function customRenderer(hotInstance, td, row, column, prop, value, cellProperties) {
  // ...your custom logic of the renderer
}
1 Like