Check initial state on dom loaded & check if has devices
This commit is contained in:
parent
d27cc46f64
commit
cc7b453c06
|
@ -104,6 +104,13 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
btnSelectAll.checked = false;
|
btnSelectAll.checked = false;
|
||||||
btnSelectAll.indeterminate = false;
|
btnSelectAll.indeterminate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TableController.getAllDevices().length == 0) {
|
||||||
|
btnSelectAll.checked = false;
|
||||||
|
btnSelectAll.disabled = true;
|
||||||
|
} else {
|
||||||
|
btnSelectAll.disabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TableController.getAllDevices().forEach(item => {
|
TableController.getAllDevices().forEach(item => {
|
||||||
|
@ -126,6 +133,8 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||||
table.on("datatable.page", () => itemListCheckChanged());
|
table.on("datatable.page", () => itemListCheckChanged());
|
||||||
table.on("datatable.perpage", () => itemListCheckChanged());
|
table.on("datatable.perpage", () => itemListCheckChanged());
|
||||||
table.on("datatable.update", () => itemListCheckChanged());
|
table.on("datatable.update", () => itemListCheckChanged());
|
||||||
|
|
||||||
|
itemListCheckChanged();
|
||||||
})
|
})
|
||||||
|
|
||||||
function deviceSelect() {
|
function deviceSelect() {
|
||||||
|
|
Reference in New Issue