I want to sort the column when I click event is triggering tried to pass the action in the send but it is not working
click: function () {
if (!this.get('sortable') && !this.get('column.sortable')) {
return;
}
this.get('controller').send('sort', this.get('column'));
return false;
}
Sort method is not working
actions: {
sort: function (column) {
var current = this.get('model.sort');
current = current ? current.split(':') : [ ];
if (current[0] === column.name && current[1] === 'asc') {
current = [column.name, 'desc'];
} else if (current[0] === column.name && current[1] === 'desc') {
current = [];
} else {
current = [ column.name, 'asc'];
}
current = current.join(':');
this.set('model.sort', current);
}
}
Please help me out