Skip to content
Snippets Groups Projects
Commit 804b68e1 authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon:
Browse files

Fix element with id "select_all" not found

parent 92b9b915
Branches
No related tags found
No related merge requests found
Pipeline #216920 passed
...@@ -145,10 +145,11 @@ export class TabulatorTable extends ScopedElementsMixin(DBPLitElement) { ...@@ -145,10 +145,11 @@ export class TabulatorTable extends ScopedElementsMixin(DBPLitElement) {
if (allSelected) { if (allSelected) {
this.tabulatorTable.deselectRow(); this.tabulatorTable.deselectRow();
this._('#select_all').checked = false;
} else { } else {
this.tabulatorTable.selectRow("visible"); this.tabulatorTable.selectRow("visible");
this._('#select_all').checked = true; }
if (this._('#select_all')) {
this._('#select_all').checked = !allSelected;
} }
e.preventDefault(); e.preventDefault();
}, },
...@@ -157,13 +158,11 @@ export class TabulatorTable extends ScopedElementsMixin(DBPLitElement) { ...@@ -157,13 +158,11 @@ export class TabulatorTable extends ScopedElementsMixin(DBPLitElement) {
} }
rowClickFunction(e, row) { rowClickFunction(e, row) {
if (this.tabulatorTable !== null && if (!this._('#select_all') || !this.tabulatorTable)
this.tabulatorTable.getSelectedRows().length === return;
this.tabulatorTable.getRows("visible").length) {
this._('#select_all').checked = true; const check = this.tabulatorTable.getSelectedRows().length === this.tabulatorTable.getRows("visible").length;
} else { this._('#select_all').checked = check;
this._('#select_all').checked = false;
}
} }
/** /**
...@@ -195,6 +194,7 @@ export class TabulatorTable extends ScopedElementsMixin(DBPLitElement) { ...@@ -195,6 +194,7 @@ export class TabulatorTable extends ScopedElementsMixin(DBPLitElement) {
setData(data) { setData(data) {
if (!this.tabulatorTable) if (!this.tabulatorTable)
return; return;
this.data = data; this.data = data;
this.tabulatorTable.setData(this.data); this.tabulatorTable.setData(this.data);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment