Checkbox readonly

Tags: #<Tag:0x00007efc6b922048> #<Tag:0x00007efc6b921a80>

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 )
];

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.

Hi @rcarney

Do you need anything else or we can close this thread?

Yes, this can be closed. Thank you.

Thank you for the confirmation, @rcarney