From 2631cba9ccedbc8926eaec65dbc572c539e3e7a0 Mon Sep 17 00:00:00 2001 From: Ayush Singh Date: Tue, 15 Aug 2017 16:05:13 +0100 Subject: [PATCH] Add clear selection option in Column-filter Dropdown --- .../directives/mdtDropdownColumnFilterDirective.js | 6 ++++++ app/modules/main/templates/mdtDropdownColumnFilter.html | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/app/modules/main/features/ColumnFilterFeature/directives/mdtDropdownColumnFilterDirective.js b/app/modules/main/features/ColumnFilterFeature/directives/mdtDropdownColumnFilterDirective.js index fd22d5d..a9a8c32 100644 --- a/app/modules/main/features/ColumnFilterFeature/directives/mdtDropdownColumnFilterDirective.js +++ b/app/modules/main/features/ColumnFilterFeature/directives/mdtDropdownColumnFilterDirective.js @@ -41,6 +41,12 @@ } }); + $scope.clearAll = function($event){ + $event.preventDefault(); + + $scope.selectedItems = []; + }; + function transformChip(chip) { if($scope.headerRowData.columnFilter.valuesTransformerCallback){ return $scope.headerRowData.columnFilter.valuesTransformerCallback(chip); diff --git a/app/modules/main/templates/mdtDropdownColumnFilter.html b/app/modules/main/templates/mdtDropdownColumnFilter.html index a72865b..7933464 100644 --- a/app/modules/main/templates/mdtDropdownColumnFilter.html +++ b/app/modules/main/templates/mdtDropdownColumnFilter.html @@ -5,6 +5,10 @@ Sort A-Z +
+ Clear +
+