refactoring

This commit is contained in:
frankknoll
2023-01-25 11:33:22 +01:00
parent 7ef46c8ee3
commit 7c520c8f64

View File

@@ -127,10 +127,7 @@ class BatchCodeTableInitializer {
return json; return json;
}) })
.then(json => { .then(json => {
this.#batchCodeTable this.#_setTableRows(json.data)
.clear()
.rows.add(json.data)
.draw();
this.#selectInput(); this.#selectInput();
}); });
} }
@@ -140,6 +137,13 @@ class BatchCodeTableInitializer {
json.data.forEach(row => row.unshift(null)); json.data.forEach(row => row.unshift(null));
} }
#_setTableRows(rows) {
this.#batchCodeTable
.clear()
.rows.add(rows)
.draw();
}
#selectInput() { #selectInput() {
const input = document.querySelector(".dataTables_filter input"); const input = document.querySelector(".dataTables_filter input");
input.focus(); input.focus();