angularjs-dropdown-multiselect icon indicating copy to clipboard operation
angularjs-dropdown-multiselect copied to clipboard

How to pass parameter to AngularJS Dropdown Multiselect onSelectionChanged event in directive?

Open smriti-chandhok opened this issue 8 years ago • 6 comments

How can i send parameters to the events.

$scope.multiuserevents = { onSelectionChanged: function (item) { $scope.myFunction(item); }}; Need to pass parameters to the onSelectionChanged Event

smriti-chandhok avatar May 23 '17 08:05 smriti-chandhok

My control is <span ng-dropdown-multiselect="" options="allUsers" selected-model="Others" events="multiuserevents" extra-settings="multiuserSetting" translation-texts="multiuserTexts" > </span>

smriti-chandhok avatar May 23 '17 08:05 smriti-chandhok

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.. }

sahaB-shock avatar Jun 29 '17 00:06 sahaB-shock

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??

luckyycool avatar Oct 24 '17 11:10 luckyycool

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); }};

yuz302 avatar Mar 01 '18 18:03 yuz302

Yep I fixed it, It was tweaky, I dont remember exactly, will look into code & wil tell u

luckyycool avatar Mar 02 '18 04:03 luckyycool

How did you solve this issue?

acidicchip avatar Jun 19 '18 15:06 acidicchip