Fix re render table
This commit is contained in:
parent
293364acfb
commit
bb284008cc
|
@ -299,15 +299,13 @@ async function processSelectedDevices() {
|
||||||
const tmpDiv = document.createElement("div")
|
const tmpDiv = document.createElement("div")
|
||||||
tmpDiv.innerHTML = newRequest
|
tmpDiv.innerHTML = newRequest
|
||||||
|
|
||||||
const oldTable = Array.from(document.querySelectorAll("table.table > tbody > tr .deviceSelect")).map(x => x.attributes["data-device-dhid"].value)
|
|
||||||
const newTable = Array.from(tmpDiv.querySelectorAll("table.table > tbody > tr .deviceSelect")).map(x => x.attributes["data-device-dhid"].value)
|
const newTable = Array.from(tmpDiv.querySelectorAll("table.table > tbody > tr .deviceSelect")).map(x => x.attributes["data-device-dhid"].value)
|
||||||
|
|
||||||
for (let i = 0; i < oldTable.length; i++) {
|
table.rows().dt.activeRows.forEach(row => {
|
||||||
if (!newTable.includes(oldTable[i])) {
|
if (!newTable.includes(row.querySelector("input").attributes["data-device-dhid"].value)) {
|
||||||
// variable from device_list.html --> See: ereuse_devicehub\templates\inventory\device_list.html (Ln: 411)
|
row.remove()
|
||||||
table.rows().remove(i)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue