How to pass parameter to AngularJS Dropdown Multiselect onSelectionChanged event in directive?
How can i send parameters to the events.
$scope.multiuserevents = { onSelectionChanged: function (item) { $scope.myFunction(item); }};
Need to pass parameters to the onSelectionChanged Event
My control is <span ng-dropdown-multiselect="" options="allUsers" selected-model="Others" events="multiuserevents" extra-settings="multiuserSetting" translation-texts="multiuserTexts" > </span>
Hi smriti-chanhok,
your selected-model ="Others" will play the role for you in onSelectionChanged. $scope.Others will have the selected value of you multi-ddl
and you can do something like below
$scope.multiuserevents = { onSelectionChanged: function () { onAllUserChange($scope.Others) };
var onAllUserChange = function(_others) { //Done deal... use _others .in your code.. }
Hi sahaB-shock,
Did u really understand her problem or pretending to fix issue? If a page has 10 dropdowns, are you saying there sud be 10 different methods to read it's related model? SERIOUSLY??
$scope.multiuserevents1 = { onSelectionChanged: function () { onAllUserChange($scope.DropDown1) }; $scope.multiuserevents2 = { onSelectionChanged: function () { onAllUserChange($scope.DropDown2) }; $scope.multiuserevents3 = { onSelectionChanged: function () { onAllUserChange($scope.DropDown3) };
No, really SERIOUSLY??
Did u solve the problem? I want to pass some parameters to the onSelectionChanged event function, because I'm using the multi-select in a ng-repeat
<div ng-repeat="x in y">
<div ng-dropdown-multiselect="" events="multiselectEvents" options="..." selected-model="...">
$scope.multiSelectevents = { onSelectionChanged: function (x) { $scope.myFunction(x); }};
Yep I fixed it, It was tweaky, I dont remember exactly, will look into code & wil tell u
How did you solve this issue?