[英]Angular ui-select ng-blur
I am using ui-select
and want to use ng-blur
on ui select, but the function I am trying to call on ng-blur
is not triggering.我正在使用
ui-select
并想在 ui select 上使用ng-blur
,但是我试图调用ng-blur
的 function 没有触发。
ng-blur
is not working on ui-select
. 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");
}
I want to trigger the function getdetails
every time the user leaves the ui-select
.每次用户离开
ui-select
时,我都想触发 function getdetails
。
It's not very clear what do you want but, if you want to take some detail about selected item, you can use this event:目前还不是很清楚你想要什么,但是,如果你想了解所选项目的一些细节,你可以使用这个事件:
<ui-select on-select="getDetails($item, $model)"> ... </<ui-select>
With version 0.19.0 of ui-select
, you can pass a directive called uis-open-close
to which you can pass a callback that is called whenever the dropdown is opened or closed.使用
ui-select
的 0.19.0 版本,您可以传递一个名为uis-open-close
的指令,您可以向该指令传递一个回调,该回调在打开或关闭下拉菜单时调用。
It contain isOpen
as an argument which is set to true if the dropdown has been opened, otherwise false.它包含
isOpen
作为参数,如果下拉菜单已打开,则设置为 true,否则为 false。
https://github.com/angular-ui/ui-select/wiki/uis-open-close https://github.com/angular-ui/ui-select/wiki/uis-open-close
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.