Fix re render table

This commit is contained in:
RubenPX 2022-04-28 15:01:39 +02:00
parent 293364acfb
commit bb284008cc
1 changed files with 10 additions and 12 deletions

View File

@ -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)
}
} }
})
} }
} }