如何在 AngularJS Dropdown Multiselect 中使用两个事件 onItemSelect 和 onItemDeselect [英] How to use two events onItemSelect and onItemDeselect in AngularJS Dropdown Multiselect

查看:24

[来源]

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>

解决方案

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]

这篇关于如何在 AngularJS Dropdown Multiselect 中使用两个事件 onItemSelect 和 onItemDeselect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆