0
votes

In my Ag grid, i have an editable column. By default, I wrote a renderer that shows a button in this cell say “add comments”. On button click, I am switching to edit mode. I am using agTextCellEditor to edit text. Once user has updated the cell, i want to use a different renderer and display the edited text. How can I achieve this in angular ag-grid? I am using angular 6.

1
See How to Ask, and especially minimal reproducible example. The idea is you describe what you want to do, show what you tried, and tell us what results you get. reproduce your issue on plunk or stackblitz so that others can help you easily. - Paritosh

1 Answers

0
votes

You can conditionally switch the Cell Renderer based on the data in the cell.

// conditionally show button and text in cell
colDef.cellRenderer = function(params) {
    return params.data.comments ? params.data.comments : YourCustomCellRenderer;
}