How to use two events onItemSelect and onItemDeselect in AngularJS Dropdown Multiselect

16,840

Try this:

$scope.yourEvents = {onInitDone: function(item) {console.log(item);},onItemDeselect: function(item) {console.log(item);}};

<div ng-dropdown-multiselect="" options="YourData" events="yourEvents" 
 selected-model="YourModel" extra-settings="yourSettings">
</div>

[source]

Share:
16,840
Jay
Author by

Jay

Full Stack Developer with 19+ years of experience.

Updated on July 16, 2022

Comments

  • Jay
    Jay almost 2 years

    I am using AngularJS Dropdown Multiselect. http://dotansimha.github.io/angularjs-dropdown-multiselect/#/

    And I want to use both the events. But don't know how to configure both. I am able to configure only one of them successfully.

    onItemSelect(property)
    

    and

    onItemDeselect(property)
    

    HTML

    <div ng-dropdown-multiselect="" options="property.dropdowns" selected-model="property.propertyValues"
                                extra-settings="multiSelectDropdownSettingsMaxOne" ng-required="property.startDate != null" events="onItemSelect(property)"></div>
    

    Update

    I tried like this with comma separator but got error

    <div ng-dropdown-multiselect="" options="property.dropdowns" selected-model="property.propertyValues" extra-settings="multiSelectDropdownSettingsMaxOne" ng-required="property.startDate != null" events="onItemSelect(property), onItemDeSelect(property)"></div>