Dash AG-grid : detect if cell_changed was triggered by user or by code

I am making an app where user has to check data showed in a ag-grid, correct it if needed. When user edits and corrects the data, the cell_changed callback records the new value back in the database.
This part works fine.

The problem is that there are several sets of data that the user pick in dropdown, and then the data is showed in the ag-grid. Every time the user chooses a new data set, the cell_changed callback is triggered. So the data that has just been retrieved from the database is uselessly recorded in the database again.

Is there a way to know if the cell_changed callback is triggered by user input (editing) or by program ?


Hello @eghza,

The easiest way would probably to bring both callbacks into one, that way you wont have the event triggering twice.

The other way would be to add your own event listener to the cellValueChanged event and check the event information yourself before passing on the data to the server.

1 Like