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

北城以北 提交于 2019-12-12 10:36:50

问题


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>

回答1:


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]



来源:https://stackoverflow.com/questions/34134815/how-to-use-two-events-onitemselect-and-onitemdeselect-in-angularjs-dropdown-mult

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!