Skip to content

Commit

Permalink
Merge pull request #191 from timaebi/master
Browse files Browse the repository at this point in the history
sortable can be defined where the columns are defined
  • Loading branch information
Zizzamia committed Dec 27, 2015
2 parents 5906b71 + da2ae55 commit b68d0e5
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 @@ -568,12 +568,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 b68d0e5

Please sign in to comment.