mura1717 / Checkbox-issues

1 stars 0 forks source link

All case Reports checked or singled checked #2

Open mura1717 opened 13 hours ago

mura1717 commented 13 hours ago

let allAssociatedReportsSelected = false;

document.querySelectorAll('.caseRecord').forEach(record => { const caseId = record.dataset.caseId; const associatedReports = document.querySelectorAll(.caseReport[data-case-id="${caseId}"]);

// Check if all associated reports for this record are selected
const allReportsChecked = Array.from(associatedReports).every(report => report.checked);

if (allReportsChecked) {
    allAssociatedReportsSelected = true;
}

});

mura1717 commented 13 hours ago

All case reports selected or single exist