Add refresh ppaginator method.
This commit is contained in:
parent
6896ba0f88
commit
02ef0b3587
@ -40,7 +40,6 @@ export class AccountsComponent implements OnInit {
|
||||
this.userService.accountsSubject.subscribe(accounts => {
|
||||
this.dataSource = new MatTableDataSource<any>(accounts);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.paginator._changePageSize(this.paginator.pageSize);
|
||||
this.dataSource.sort = this.sort;
|
||||
this.accounts = accounts;
|
||||
});
|
||||
@ -64,4 +63,12 @@ export class AccountsComponent implements OnInit {
|
||||
this.dataSource.data = this.accounts.filter(account => account.type === this.accountsType);
|
||||
}
|
||||
}
|
||||
|
||||
refreshPaginator(): void {
|
||||
if (!this.dataSource.paginator) {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
}
|
||||
|
||||
this.paginator._changePageSize(this.paginator.pageSize);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user