Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Updating cell value from callback in ag grid

I need to update the value of one of the cells in a row in ag-grid as soon as the onCellEditingStopped callback is called (this happens when a user exits any other cell on that row).

I have this code which is based on the single cell update example at Ag grid single cell update

onCellEditingStopped: {function(event) {
 event.node.setDataValue("cell_to_update","a new value");
}
}

which should update the cell with field "cell_to_update" but it doesnt.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I am wondering if that is because I am calling it from this specific callback?

>Solution :

One way is by forcing the refresh, like

onCellEditingStopped: {function(event) {
 event.node.setDataValue("cell_to_update","a new value");
event.api.refreshCells({force:true});
}
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading