Conditionally disable checkbox in columns.yaml


I want to disable a checkbox based on the record value in columns.yaml of a model.

for example. if the record value (slug) is ‘/’ then disable the checkbox.

thanks in advance.

Change the column type to switch, then include this JavaScript in your controller:

addEventListener('render', function() {
    document.querySelectorAll('').forEach(function(el) {
        el.closest('tr').querySelector('.list-checkbox input.form-check-input').disabled = true;