In angular2-datatable there's an implementation for sorting when click on the item on table head. For this we have to use DefaultSorter as:
<mfDefaultSorter [by]="sortByItem">{{ head }}</mfDefaultSorter>
the by attribute call the sortByItem method in which you can capture the event.
sortByItem(event) {
return event._id;
}
I want to pass additional parameter with the exact event. I have tried using the ref variable but that doesn't work or you can say it doesn't fulfill what I want to achieve.
In order to see it for yourself, I have created this stackblitz: https://stackblitz.com/edit/angular2-datatable
In the above mentioned example you can check sortByWordLength method. I want to pass the exact event with additional parameter.
Additional Information: