Skip to content

Commit

Permalink
sortable can be defined where the columns are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
timaebi committed Dec 20, 2015
1 parent 2cdd16d commit da2ae55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/component/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,17 @@ angular.module('ngTasty.component.table', [
isSortedCaret = '';
// Not sort column when the key is present in the `notSortBy` list,
// and Not sort column when `notSortBy` is an empty list
// If sortable property is present in column object, then use it
if (angular.isArray(scope.notSortBy)) {
if (scope.notSortBy.length) {
sortable = scope.notSortBy.indexOf(column.key) < 0;
} else {
sortable = false;
}
} else {
if (angular.isDefined(column.sortable)) {
sortable = column.sortable === true;
}
}
if (column.key === scope.header.sortBy ||
'-' + column.key === scope.header.sortBy) {
Expand Down

0 comments on commit da2ae55

Please sign in to comment.