In the grid, the editability of columns should depend on the value in column 1 (Index 0).
- If the value in column 1 is “Product”, all cells should be writable except for columns 2 and 10.
- If the value is “Text”, all cells should be read-only except for columns 1 and 4, which should be editable.
The corresponding updateSettings is structured as follows:
hot.updateSettings({
cells(row, col) {
return (hot.getData()[row][0] == ‘Text’ && col != 0 && col != 3) ||
(hot.getData()[row][0] == ‘Produkt’ && (col == 1 || col == 9)) ||
(hot.getData()[row][0] == undefined && col != 0) ? { readOnly: true } : { readOnly: false };
},
});
When the user moves rows within the grid, the individual cell properties are not updated. If a Product row and a Text row are swapped, the new Product row inherits the properties of the Text row and vice versa.
How can this be solved? Thanks in advance.