Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear selection option in Column-filter Dropdown #326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions app/modules/main/templates/mdtDropdownColumnFilter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<a href="#" ng-click="sortingCallback($event, sortingData)">Sort A-Z <mdt-sorting-icons size="20" data="sortingData" class="p-l-sm"></mdt-sorting-icons></a>
</div>

<div layout="row" layout-align="start center" class="selectall_clearall p-l-md p-t-md p-b-sm">
<a href="#" ng-class="{'disabled' : isNothingSelected()}" ng-click="clearAll($event)">Clear</a>
</div>

<div class="p-md">
<md-input-container class="md-block" flex-gt-sm>
<md-select ng-model="oneSelectedItem" placeholder="{{placeholderText}}" ng-change="selectedItem()">
Expand Down