Merge pull request #3235 from vvlladd28/improvement/alarm-widget/add-disable-sort

[3.0] Disabled column sort for alarm widget for details key
This commit is contained in:
Igor Kulikov 2020-08-05 11:26:54 +03:00 committed by GitHub
commit 4aede40c5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -78,7 +78,9 @@
</mat-cell>
</ng-container>
<ng-container [matColumnDef]="column.def" *ngFor="let column of columns; trackBy: trackByColumnDef;">
<mat-header-cell [ngStyle]="headerStyle(column)" *matHeaderCellDef mat-sort-header> {{ column.title }} </mat-header-cell>
<mat-header-cell [ngStyle]="headerStyle(column)" *matHeaderCellDef mat-sort-header [disabled]="isSorting(column)">
{{ column.title }}
</mat-header-cell>
<mat-cell *matCellDef="let alarm;"
[innerHTML]="cellContent(alarm, column)"
[ngStyle]="cellStyle(alarm, column)">

View File

@ -840,6 +840,9 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
}
}
isSorting(column: EntityColumn): boolean {
return column.type === DataKeyType.alarm && column.name.startsWith('details.');
}
}
class AlarmsDatasource implements DataSource<AlarmDataInfo> {