0
votes

I am trying to implement a custom color formater in ag-grid where users can select a color from the color picker and change cell background color or font color..

I am able to get the column Def but not able to implement the changes in Ag-grid.

I have been trying:

this.data.columnApi.getColumn(index).getColDef().cellStyle['color'] = 'red';
this.data.gridApi.refreshCells();
and also
this.data.gridApi.redrawRows();

Let me know if any more information is required.

1
could you provide a demo on stackblitz? - Farhang darzi

1 Answers

1
votes

I took a look at your code and replacing

  this.gridApi.refreshCells({
        columns: ["make"]
      });

with

  this.gridApi.redrawRows();

worked for me giving the correct output