javascript - Angular ui-select ng-blur
问题描述
我正在使用ui-select
并想ng-blur
在 ui select 上使用,但我试图调用的函数ng-blur
没有触发。
ng-blur
不工作ui-select
。
<ui-select ng-blur="getdetails()" ng-model="$root.caseSearchModel.progressionDesc"
skip-focusser="true" id="current_progression_description">
<ui-select-match>
<span ng-bind-html="$select.selected.DESC1"></span>
</ui-select-match>
<ui-select-choices repeat="item.DESC2 as item in progressionDescs | filter: { DESC2: $select.search }">
<div ng-bind-html="item.DESC1 | highlight: $select.search"></div>
</ui-select-choices>
<ui-select-no-choice>
Does not match.
</ui-select-no-choice>
</ui-select>
$scope.getdetails = function () {
console.log("i am in blur function");
}
我想在getdetails
每次用户离开时触发该功能ui-select
。
解决方案
使用 0.19.0 版本ui-select
,您可以传递一个调用的指令uis-open-close
,您可以传递一个回调,该回调在打开或关闭下拉菜单时调用。
它包含isOpen
作为参数,如果下拉菜单已打开,则设置为 true,否则为 false。
推荐阅读
- ios - 在 iOS 上使用 Django 和 Alamofire 上传图像
- css - WordPress 和 CSS 没有按我的预期工作
- c++ - return() 中的函数调用
- php - 在 WooCommerce 中为特定国家/地区设置最小允许重量
- twitter-bootstrap - 将引导文件添加到 IntelliJ 项目
- java - 借助泛型和反射的 Java di 模块
- datetime - 错误的程序员相信时间
- scala - scalatest intercept vs a[Exception] should be thrownBy
- java - LinkedHashMap 大小不变
- thymeleaf - Remove trailing zeros on currency