Posted 27 September 2020, 11:44 pm EST - Updated 3 October 2022, 6:30 am EST
Dear Wijmo Team,
I’m currently trying to disable cells by using itemFormat EventHandler.
When a column is readOnly, I want the cells to appear disabled.
When a certain row is editable, I want the cells to appear editable
But additionally, I want two certain columns to appear disabled, regardless of the certain row. How can I achieve this.
Here is my code:
//regular cells
if (e.panel == s.cells) {
let item = s.rows[e.row].dataItem;
if (!item) {
return
}
// Disable isReadOnly row
let disabledCell: string = "disabled-cell";
if(item.isReadOnly) {
s.rows[e.row].cssClass = disabledCell;
}
// Enalbe special row
if(item.isSpecialRow) {
let classes = e.cell.classList;
classes.remove(disabledCell);
}
// Disable isReadOnly columns
let column = s.columns[e.col];
if(column.isReadOnly) {
column.cssClass = disabledCell;
}
}
The result of this code looks like this
- All columns are set to be readOnly
- Only second row is editable
But I want the first two columns of the second row to look disabled, too. How can I achieve that?
Best regards
Moritz