我有3个单选按钮。根据所选的单选按钮,我希望使下拉列表单选,多选和禁用。任何帮助?使用ng-class的范围是什么?将类添加到HTML选择,取决于Angular JS中的单选按钮值。
在页面加载,多个单选按钮将被检查和DDL将多选)。 如果我改变,radiobuttonValue ==单,然后DDL应该是正常的(除去多选 如果radiobuttonValue ==所有,然后DDL应该禁用
<div class="form-group">
<div class="col-sm-4">
<div class="radio">
<label>
<input type="radio" name="portRadios" id="portRadios1" value="single" ng-model="activity.portRadios">
Single Port
</label>
<label>
<input type="radio" name="portRadios" id="portRadios2" value="multiple" ng-model="activity.portRadios" checked="checked">
Multiple Port
</label>
<label>
<input type="radio" name="portRadios" id="portRadios3" value="all" ng-model="activity.portRadios">
All Ports
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">City/Port :</label>
<div class="col-sm-4">
<select multiple name="ActivityPort" class="form-control" ng-model="activity.selectedPort" ng-show="portradios == single" ng-options="b.Name for b in portList track by Name">
<option value="">-- Select a Port --</option>
</select>
</div>
</div>
取决于单选按钮u必须在选择字段加载不同的数据? –
不,我想将下拉列表设置为单值选择/多值选择/禁用 –
您想从下拉列表中选择多个值而不是一个值吗?基于你的单选按钮?这样对吗 ? –