Reputation: 4491
I want to refresh data-table when click on one button. There are 3 buttons.
Example: stackblitz (not redirecting to customer page)
I am not getting why it's not updating the list in data-table. Data table is generic. So need to pass only data source.
Upvotes: 0
Views: 2672
Reputation: 214017
If you expect that your custom data-table wrapper should respond to input changes then you need to handle this behavior either in ngOnChanges or using setters:
ngOnChanges(changes: SimpleChanges) {
if (changes['tableData']) {
this.dataSource = new MatTableDataSource(this.tableData);
this.displayedColumns = this.columnHeader.map(c => c.columnDef);
}
}
Upvotes: 1