We are facing issue, we need to make a checkbox readOnly if cell value is 1.
const columns = [
{
id: 15,
data: ‘Default_Entry’,
header: ‘Default’,
className: ‘htCenter htMiddle’,
active: true,
type: ‘checkbox’,
checkedTemplate: ‘1’,
uncheckedTemplate: ‘0’
}
We tried custom renderer but it changes checbox to select/input.
const defaultEntryRenderer = (instance, td, row, col, prop, value, cellProperties) => {
if (value == 1) {
cellProperties.readOnly = true;
} else {
cellProperties.readOnly = false;
}
td.classList.add(‘hot_table_grid’);
}; We want to keep using checkbox but make it readOnly depening on value ( 1 )
];
Checkbox readonly
Hi @rcarney
Thank you for contacting us. The reason why your custom renderer doesn’t work is because you have to also apply the base reference for the checkbox renderer. I have an example here that shows how to do it:
https://jsfiddle.net/handsoncode/d1tzrbqg/
Let me know if that is your expected result.
Yes, this can be closed. Thank you.