parent
7503895a4f
commit
b88a514edf
|
@ -18,9 +18,9 @@ $(document).ready(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
class TableController {
|
class TableController {
|
||||||
static #tableRows = table.rows().dt.activeRows;
|
static #tableRows = table.activeRows;
|
||||||
|
|
||||||
static #tableRowsPage = table.rows().dt.pages[table.rows().dt.currentPage - 1];
|
static #tableRowsPage = () => table.pages[table.rows().dt.currentPage - 1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns Selected inputs from device list
|
* @returns Selected inputs from device list
|
||||||
|
@ -35,7 +35,7 @@ class TableController {
|
||||||
* @returns Selected inputs in current page from device list
|
* @returns Selected inputs in current page from device list
|
||||||
*/
|
*/
|
||||||
static getAllSelectedDevicesInCurrentPage() {
|
static getAllSelectedDevicesInCurrentPage() {
|
||||||
return this.#tableRowsPage
|
return this.#tableRowsPage()
|
||||||
.filter(element => element.querySelector("input").checked)
|
.filter(element => element.querySelector("input").checked)
|
||||||
.map(element => element.querySelector("input"))
|
.map(element => element.querySelector("input"))
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class TableController {
|
||||||
* @returns All inputs from current page in device list
|
* @returns All inputs from current page in device list
|
||||||
*/
|
*/
|
||||||
static getAllDevicesInCurrentPage() {
|
static getAllDevicesInCurrentPage() {
|
||||||
return this.#tableRows
|
return this.#tableRowsPage()
|
||||||
.map(element => element.querySelector("input"))
|
.map(element => element.querySelector("input"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue