Fix loading in table

master
Max Ehrlicher-Schmidt 4 years ago
parent 1a50021c0e
commit 4ef5d93c4f

@ -20,7 +20,7 @@
class="table-control-button"
matTooltip="Tabllendaten aktualisieren. Achtung! Alle ungespeicherten Änderungen gehen verloren."
(click)="reloadTable()"
[disabled]="reloadingTable"
[disabled]="reloadingTable || !isLoaded"
>
<mat-icon class="spin">sync</mat-icon>
</button>
@ -76,7 +76,7 @@
cdkDropListOrientation="horizontal"
(cdkDropListDropped)="drop($event)"
[dataSource]="data"
[ngClass]="{ 'idle-overlay': !isLoaded }"
[ngClass]="{ 'idle-overlay': !isLoaded || reloadingTable }"
>
<!--- Note that these columns can be defined in any order.
The actual rendered columns are set as a property on the row definition" -->
@ -383,7 +383,7 @@
>
<mat-spinner
class="idle-spinner"
*ngIf="!isLoaded || isProcessing"
*ngIf="!isLoaded || isProcessing || reloadingTable"
[diameter]="48"
></mat-spinner>
</div>

@ -164,14 +164,14 @@ export class TableComponent implements AfterViewInit {
this.dataService.tableData.subscribe((newTableDataSource) => {
const tempDataSource = [];
this.isLoaded = true;
this.reloadingTable = false;
this.loadingErrorOccurred = false;
if (newTableDataSource == null) {
this.data.data = [];
this.loadingErrorOccurred = true;
this.loadingErrorOccurred = false;
return;
}
this.isLoaded = true;
this.reloadingTable = false;
this.loadingErrorOccurred = false;
for (const row of newTableDataSource) {
if (row.newObject) {
// its a copied object

Loading…
Cancel
Save