Reputation: 119
I'd like to reset the sort state of primeng datable. i am able to reset full datatable but still sort state is not reset
Upvotes: 11
Views: 14514
Reputation: 2037
This worked for me:
HTML
<p-table #table ...>
TS
import {Table} from 'primeng/table';
@ViewChild('table') table: Table;
resetSort() {
this.table.sortOrder = 0;
this.table.sortField = '';
this.table.reset();
}
Upvotes: 10