Skip to content

Commit 35ec4e6

Browse files
authored
Release 3.36.1
2 parents ed72835 + 05cfc73 commit 35ec4e6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/app/core/common-components/entities-table/entities-table.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
AfterViewInit,
32
Component,
43
EventEmitter,
54
Input,
@@ -68,7 +67,7 @@ import { EntityDatatype } from "../../basic-datatypes/entity/entity.datatype";
6867
templateUrl: "./entities-table.component.html",
6968
styleUrl: "./entities-table.component.scss",
7069
})
71-
export class EntitiesTableComponent<T extends Entity> implements AfterViewInit {
70+
export class EntitiesTableComponent<T extends Entity> {
7271
@Input() set records(value: T[]) {
7372
if (!value) {
7473
return;
@@ -164,8 +163,13 @@ export class EntitiesTableComponent<T extends Entity> implements AfterViewInit {
164163
this._sortBy = value;
165164
this.sortIsInferred = false;
166165
}
166+
167167
_sortBy: Sort;
168-
@ViewChild(MatSort, { static: true }) sort: MatSort;
168+
169+
@ViewChild(MatSort, { static: false }) set sort(sort: MatSort) {
170+
this.recordsDataSource.sort = sort;
171+
}
172+
169173
private sortIsInferred: boolean = true;
170174

171175
/**
@@ -293,10 +297,6 @@ export class EntitiesTableComponent<T extends Entity> implements AfterViewInit {
293297
this.recordsDataSource = this.createDataSource();
294298
}
295299

296-
ngAfterViewInit(): void {
297-
this.recordsDataSource.sort = this.sort;
298-
}
299-
300300
private createDataSource() {
301301
const dataSource = new MatTableDataSource<TableRow<T>>();
302302
dataSource.sortData = (data, sort) =>

0 commit comments

Comments
 (0)