无法禁用多选择下拉菜单 [英] Not able to disable a multi-select drop down
问题描述
所以,我做了逻辑,并帮助我尝试禁用下拉菜单 -
document.getElementById(multidropdown)。disabled = true;
但没有运气。
然后我google了,并了解ng-disable。所以,我在那里放了一个ng禁用,并给它一个这样的名字
ng-disabled =makeItDisabled
在我的js文件中,我设置了
$ scope.makeItDisabled = false
在这种情况下,相同的
$ scope.makeItDisabled = true
但是还是没有运气。
这是我的HTML-
column type =dropdownMultiSelectstyleName =form-control ng-isolate-scope multidropdownng-dropdown-multiselect =options =dropdownDataselectedmodel =dropdownelectextrasettings = multiselectsettingsevents =DropDown_changedtext =uniqueID =multidropdownng-disabled =makeItDisabled
这是我试过的js代码
document.getElementById(multidropdown)。disabled = true;
还有
$ scope.makeItDisabled = true;
我也和残疾人一样,但是我也无法做到这一点。我想知道我在哪里错了。
我正在使用这个
https://github.com/dotansimha/angularjs-dropdown-multiselect
最后我通过使用css
可以使用
指针事件:无;
Hi I am new to AngularJs. Here my problem is on a certain condition I need to disable my multiselect dropdown.
So, I made the logic and on with the help of I tried to disable the dropdown-
document.getElementById("multidropdown").disabled = true;
But no luck.
So, then I google it and get to know about ng-disable. So, I put a ng-disable there and give it a name like this
ng-disabled="makeItDisabled"
And in my js file, I set
$scope.makeItDisabled = false
And in the condition, I made the same
$scope.makeItDisabled = true
But still got no luck.
This is my HTML-
column type="dropdownMultiSelect" styleName="form-control ng-isolate-scope multidropdown" ng-dropdown-multiselect="" options="dropdownData" selectedmodel="dropdownelect" extrasettings="multiselectsettings" events="DropDown_changed" text="" uniqueID="multidropdown" ng-disabled=" makeItDisabled
This is my js code which I have tried
document.getElementById("multidropdown").disabled = true;
and also
$scope.makeItDisabled = true;
I did the same with the disabled also but there also I was not able to do it. I want to know where I am getting it wrong.
I am using this https://github.com/dotansimha/angularjs-dropdown-multiselect
Finally I was able to do it by just using css
I disabled the dropdown by using
pointer-events:none;
这篇关于无法禁用多选择下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!