adds check all checkbox

This commit is contained in:
2025-02-10 02:42:27 +01:00
parent 595237c172
commit 12e7cffca1
7 changed files with 33 additions and 31 deletions

7
app/static/common.js Normal file
View File

@@ -0,0 +1,7 @@
function checkAllCheckboxes(tableId, checkAllCheckboxId) {
const table = document.getElementById(tableId);
const checkboxes = table.querySelectorAll('input[type="checkbox"]');
const checkAllCheckbox = document.getElementById(checkAllCheckboxId);
checkboxes.forEach(checkbox => checkbox.checked = checkAllCheckbox.checked);
}

View File

@@ -93,12 +93,4 @@ function sortTable(columnIndex, tableId) {
// Reinsert sorted rows
rows.forEach(row => tbody.appendChild(row));
}
function checkAllCheckboxes(tableId, checkAllCheckboxId) {
const table = document.getElementById(tableId);
const checkboxes = table.querySelectorAll('input[name="fileCheckbox"]');
const checkAllCheckbox = document.getElementById(checkAllCheckboxId);
checkboxes.forEach(checkbox => checkbox.checked = checkAllCheckbox.checked);
}
}