I'm using devextreme-react. I need to make some cells insertable (new rows) but not editable (existing rows), but configuration provide only 'allowEditing' options that doesn't distinguish between inserting new records or editing existing ones.
I tried to provide to each cell custom parameters 'insertable' and 'editable' in order to make a cell editable separately in different context (only insertable, only editable, in both contexts).
Then I tried two approaches:
Here is an example of first approach:
As you can see, there are some problems:
Also using second approach focus is not always triggered and manually enabling editor does nothing
The only way I found to solve this problem is using editCellRender, then the editor is shown only when appropriate conditions are met.
In order to use editCellRender I've to separate columns configuration from grid configuration and use Column component (Datagrid.Column from devextreme-react/data-grid)
To distinguish between insert and update I rely on dxkey prop, I'm not sure this is the best way.
Here is a fork of codesandbox with solution: