From da2ae555c20cb4db322eddd86cca07466087068f Mon Sep 17 00:00:00 2001 From: timaebi Date: Sun, 20 Dec 2015 02:09:59 +0100 Subject: [PATCH] sortable can be defined where the columns are defined --- src/component/table.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/component/table.js b/src/component/table.js index 504fbf3f..79436256 100644 --- a/src/component/table.js +++ b/src/component/table.js @@ -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) {