Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

onDeselectAll is not working as expected #446

Open
NarasinghaP opened this issue Nov 22, 2017 · 1 comment
Open

onDeselectAll is not working as expected #446

NarasinghaP opened this issue Nov 22, 2017 · 1 comment

Comments

@NarasinghaP
Copy link

NarasinghaP commented Nov 22, 2017

Hello @pkempenaers
If I am calling a function on Uncheck all, the same function also gets called when Check All is clicked.
my HTML Code
<div ng-dropdown-multiselect="" options="facilities" selected-model="invoice.facilities" extra-settings="multidropdownSettings" form-name="step_one_form" translation-texts="translationText" events="customEvents"></div>
My javaScript Code
$scope.customEvents = { onSelectAll: function () { console.log('checked') }, onUnselectAll: function () { console.log('unchecked') } };
When Uncheck is clicked, in console, only unchecked is printing. But if Check All is clicked, both checked and unchecked are printed.
My question is how to call a function only when Uncheck All is clicked? I even saw this . It did not help.

In addition to that the in angularjs-dropdown-multiselect.js the function selectAll contains following code.
$scope.selectAll = function () { $scope.deselectAll(false); $scope.externalEvents.onSelectAll(); angular.forEach($scope.options, function (value) { $scope.setSelectedItem(value[$scope.settings.idProp], true); }); };
If i remove/comment $scope.deselectAll(false);, it works as expected.
Please do help me with this issue.

@dallasbrittany
Copy link

dallasbrittany commented Nov 30, 2017

Have you tried using onDeselectAll? I'm using it in my code, and it's working well. You have it listed in the title of this post, but your code doesn't seem to have it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants