Search code examples
ag-gridag-grid-angular

Dynamically changing Cell Renderer of ag-grid using param


I'm new at ag grid and I'm trying to return some value according a boolean.

So I tried:

{ headerName: 'Teste', field: 'active'
cellRendererParams: (params: any) => { return params.value === true ? 'sim' : 'nao'}
}

but the cell still show me the value true or false.


Solution

  • If you need just to display a different value, use value formatter:

    valueFormatter: params => params.value === true ? 'sim' : 'nao'