Open lundmikkel opened 5 years ago
The context (this) inside custom sorting functions point to the AureliaTableCustomAttribute instead of the code-behind class.
this
AureliaTableCustomAttribute
I have a code-behind class containing the following code:
public dateComparer(date1, date2, sortOrder) { return date1 === date2 ? 0 : ((date1 < date2 ? -1 : 1) * sortOrder); } public dateSort(a, b, sortOrder) { console.log(this); return this.dateComparer(a.date, b.date, sortOrder); }
With an HTML table with aut-sort="custom.bind: dateSort" attribute on it. When sorting the column, I get the following message:
aut-sort="custom.bind: dateSort"
The context (
this
) inside custom sorting functions point to theAureliaTableCustomAttribute
instead of the code-behind class.I have a code-behind class containing the following code:
With an HTML table with
aut-sort="custom.bind: dateSort"
attribute on it. When sorting the column, I get the following message: