Browse Source

Fixed jumping rows when updating data in Gateway Logs table

pull/11028/head
mpetrov 2 years ago
parent
commit
522c926ca5
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-logs.component.html
  2. 5
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-logs.component.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-logs.component.html

@ -21,7 +21,7 @@
[active]="activeLink.name === link.name"> {{ link.name }} </a>
</nav>
<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>
<table mat-table [dataSource]="dataSource"
<table mat-table [dataSource]="dataSource" [trackBy]="trackByLogTs"
matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="pageLink.sortDirection()"
matSortDisableClear>
<ng-container matColumnDef="ts">

5
ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-logs.component.ts

@ -164,6 +164,10 @@ export class GatewayLogsComponent implements AfterViewInit {
}
}
trackByLogTs(_: number, log: GatewayLogData): number {
return log.ts;
}
private changeSubscription() {
if (this.ctx.datasources && this.ctx.datasources[0].entity && this.ctx.defaultSubscription.options.datasources) {
this.ctx.defaultSubscription.options.datasources[0].dataKeys = [{
@ -178,5 +182,4 @@ export class GatewayLogsComponent implements AfterViewInit {
};
}
}
}

Loading…
Cancel
Save