You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With inline row editing, or modal editing, MRT manages the save and cancel operations for me. Pressing cancel resets the value to the original, and pressing save calls the function I pass into onEditingSaveRow to update the underlying data.
But it seems that inline cell editing works very differently -- it doesn't call onEditingSaveRow. Instead, in the example given, we need to manually hook into muiEditTextFieldProps on each individual column to handle the save operation. There isn't really a good way to cancel the operation and reset the value. (Maybe not having a cancel is OK in this mode, I'm not sure.)
Clearly, handling this ourselves in each column is not as simple or clean as the other two modes. Questions:
Could MRT be updated to call onEditSaveRow for an inline edit? It's not clear why that wouldn't work just fine; MRT can easily stitch in the updated value on the proper field and call onEditSaveRow with the result. (And I could still override muiEditTextFieldProps if I wanted more granular control.)
If (1) is not possible for some reason, could we provide an onEditSaveCell method, and let the upstream code figure out how to stitch in the value?
If not, can anyone suggest a cleaner way to make this work without having to repeat myself on every column?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
With inline row editing, or modal editing, MRT manages the save and cancel operations for me. Pressing
cancel
resets the value to the original, and pressingsave
calls the function I pass intoonEditingSaveRow
to update the underlying data.But it seems that inline cell editing works very differently -- it doesn't call
onEditingSaveRow
. Instead, in the example given, we need to manually hook intomuiEditTextFieldProps
on each individual column to handle the save operation. There isn't really a good way to cancel the operation and reset the value. (Maybe not having a cancel is OK in this mode, I'm not sure.)Clearly, handling this ourselves in each column is not as simple or clean as the other two modes. Questions:
onEditSaveRow
for an inline edit? It's not clear why that wouldn't work just fine; MRT can easily stitch in the updated value on the proper field and callonEditSaveRow
with the result. (And I could still overridemuiEditTextFieldProps
if I wanted more granular control.)onEditSaveCell
method, and let the upstream code figure out how to stitch in the value?Beta Was this translation helpful? Give feedback.
All reactions