According to ag-grid you can use a custom callback onCellEditingStopped
.
This will trigger every time a cell editing is ended.
You define it directly on the grid options object and you can also access the edited values (and its row and column) like this:
const gridOptions = {
columnDefs: [/* whatever */],
defaultColDef: {/* whatever */},
rowData: rowData,
onCellEditingStopped: function(event) {
console.log(event);
console.log(event.oldValue); // cell's previous value
console.log(event.newValue); // cell's new value
console.log(event.column); // the column that was edited
console.log(event.data); // the row that was edited
},
};
// setup the grid after the page has finished loading
document.addEventListener('DOMContentLoaded', function() {
var gridDiv = document.querySelector('#myGrid');
new agGrid.Grid(gridDiv, gridOptions);
});
Here you have a detailed explanation of whenever this onCellEditingStopped
is triggered.
You can also inspect the full example.