Is there a way to update an Angular Material table's datasource (rows) according to the changes that have been made by drag and drop on the columns?
I have a dropListedDrop
event which updates columns:
dropListDropped(event: CdkDropList, index: number) {
if (event) {
moveItemInArray(this.headers, this.previousIndex, index);
this.setDisplayedColumns();
}
}
But the data in dataSource isn't being changed automatically after the drag and drop action completes.
Example here: StackBlitz