I am working with grid with multiple checkbox columns in the the grid. The state of the checkbox (check or unchecked) is based on the webservice response.
I have added two checkbox columns shown as below,
// Column 1
{
text : 'Column1',
dataIndex : 'Column1',
align: 'center',
renderer: function(value, meta, record, rowIndex, colIndex) {
if(record != null && record.get('text') === 'col1') {
value = '<input type = "checkbox" checked />';
} else {
value = '<input type = "checkbox" />';
}
return value;
}
},
// Column 2
{
text : 'Column2',
dataIndex : 'Column2',
align: 'center',
renderer: function(value, meta, record, rowIndex, colIndex) {
if(record != null && record.get('text') === 'col2') {
value = '<input type = "checkbox" checked />';
} else {
value = '<input type = "checkbox" />';
}
return value;
}
},
Now, I have to disable column 2 if column 1 is checked and vice versa. I tried to work with checkcolumn but it is not working as expected.
I am not sure, how to associate a listener to checkbox in the column render.
Any help pointers would be great.