我有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必須在選擇字段加載不同的數據? –
不,我想將下拉列表設置爲單值選擇/多值選擇/禁用 –
您想從下拉列表中選擇多個值而不是一個值嗎?基於你的單選按鈕?這樣對嗎 ? –