I am working with React's Material Table. I am trying to bulk edit only one column. I tried:
import {tableIcons} from '../../../components/table/SortableTable'
import MaterialTable from "material-table";
< MaterialTable
icons = {
tableIcons
}
title = "Table"
columns = {
columns.map((item, index) => ({
title: item,
field: item,
}))
}
data = {
data
}
editable = {
{
onBulkUpdate: selectedRows =>
new Promise((resolve, reject) => {
console.log(selectedRows)
setTimeout(() => {
resolve();
}, 1000);
}),
}
}
/>
But this only enables you to edit the whole table.
So I tried to add this option:
columns = {
columns.map((item, index) => ({
title: item,
field: item,
editable: item=='columnIwannaEdit'? 'onUpdate' : 'never',
}))
But it seems this only works when editing a single row at a time but not with bulk edit.
Any ideas please?
Thank you !