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