I am planning to pass a props showAdd so that I have an option to make it Add option available only when this props is true.
You can use editComponent feature to customize editable field.
Look at 3rd example: https://material-table.com/#/docs/features/editable
If you want to add button with a condition:
onRowAdd: condition ? newData =>
new Promise((resolve, reject) => {
setTimeout(() => {
{
/* const data = this.state.data;
data.push(newData);
this.setState({ data }, () => resolve()); */
}
resolve();
}, 1000);
}) : null,
@mbrn Thanks that worked
Most helpful comment
If you want to add button with a condition: