when i want to add a new row in the materialtable i need that the field date must be auto-generated and taks the value of current date and this date can't be editable in update or in insert
this my solution but its not working
columns: [
{
...,
title: 'date',
field: 'fieldDate',
type: 'date',
default: new Date()
},
...]
According to the documentation you can use the initialEditValue
to set the value of a new row: https://material-table.com/#/docs/all-props
Your columns definition would be:
columns: [
{
...,
title: 'date',
field: 'fieldDate',
type: 'date',
initialEditValue: new Date()
},
...
]