fixed the select all cb

This commit is contained in:
2025-05-26 21:37:44 -04:00
parent b49778215f
commit 78fc027c24

View File

@@ -477,15 +477,17 @@ $style = @'
// Column “Select All” toggling for On-Boarding
// =======================================================================
function toggleColumn(col) {
const master = document.getElementById(
`selectAll${col[0].toUpperCase() + col.slice(1)}Checkbox`
);
document
.querySelectorAll(
`#onboardTab input[type=checkbox][data-column=${col}]`
)
.forEach(cb => (cb.checked = master.checked));
}
const master = document.getElementById(`selectAll${col[0].toUpperCase() + col.slice(1)}Checkbox`);
const children = document.querySelectorAll(`#onboardTab input[type=checkbox][data-column=${col}]`);
children.forEach(cb => {
cb.checked = master.checked;
// Trigger native change event so the suboption logic runs
cb.dispatchEvent(new Event('change'));
});
}
// =======================================================================
// Un-check “Select All” if any child is unchecked (& re-check if all are checked)