Check initial state on dom loaded & check if has devices

This commit is contained in:
RubenPX 2022-05-11 11:19:56 +02:00
parent d27cc46f64
commit cc7b453c06

View file

@ -104,6 +104,13 @@ window.addEventListener("DOMContentLoaded", () => {
btnSelectAll.checked = false;
btnSelectAll.indeterminate = false;
}
if (TableController.getAllDevices().length == 0) {
btnSelectAll.checked = false;
btnSelectAll.disabled = true;
} else {
btnSelectAll.disabled = false;
}
}
TableController.getAllDevices().forEach(item => {
@ -126,6 +133,8 @@ window.addEventListener("DOMContentLoaded", () => {
table.on("datatable.page", () => itemListCheckChanged());
table.on("datatable.perpage", () => itemListCheckChanged());
table.on("datatable.update", () => itemListCheckChanged());
itemListCheckChanged();
})
function deviceSelect() {