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
I read that you can do Edit: () => null to remove a field from the form, but what if you want it to appear in the modal for insert, but not for updates?
Currently I'm trying this
Edit: ({ cell, column, row, table }) => {
if (!!table.getState().creatingRow) return null
else return <MRT_EditCellTextField cell={cell} column={column} row={row} table={table} />
}
But this creates an infinite loop. What should I be returning when I want the normal input?
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I read that you can do Edit: () => null to remove a field from the form, but what if you want it to appear in the modal for insert, but not for updates?
Currently I'm trying this
Edit: ({ cell, column, row, table }) => {
if (!!table.getState().creatingRow) return null
else return <MRT_EditCellTextField cell={cell} column={column} row={row} table={table} />
}
But this creates an infinite loop. What should I be returning when I want the normal input?
Edit: I think I can just do something like this
muiEditTextFieldProps: ({ table }) => (!!table.getState().creatingRow ? {} : { sx: { display: "none" } })
Thanks,
BIll
Beta Was this translation helpful? Give feedback.
All reactions