I've been attempting to remove the applied sorting on a table programmatically using the active
and direction
fields, but so far, I haven't been successful:
@ViewChild(MatSort) sort: MatSort;
private clearSort() {
// Clear the active sort column
this.sort.active = "";
// Reset the sort direction
this.sort.direction = "";
}
I've checked out the Sort Header Documentation, but unfortunately, I couldn't find any built-in method that allows for clearing an applied sort on a specific table.
If anyone has any advice on how to achieve this, I would greatly appreciate it.