I'm jumping in on a pretty big React JS project which is using react-data-grid
to display a bunch of editable data. Right now, you have to click an Update button to send changes to the server. My task at hand is to create auto-save functionality like so:
- User selects cell to edit text
- User changes text
- User either moves to another cell or clicks away from data-grid
- Changes are persisted to the server
Here's what I've tried:
onBlur
event on each column. The event will fire, but it seems like the event was attached to adiv
and not the underlyinginput
control. Therefore, I don't have access to the cell's values at the time this event is fired.onCellDeselected
on the<ReactDataGrid>
component itself. It seems like this method is fired immediately upon render, and it only gets fired subsequent times when moving to another cell. If I'm editing the last cell and click away from the data-grid, this callback isn't fired.
Using react-data-grid
, how can I effectively gain access to an editable cell's content when the user finishes editing?