1
好球員,我得到了這樣的事情:AngularJS如何在ComboBox中取消全部選擇?
<select style="width: 100px;"
ng-disabled="true"
ng-model="selectedStudent.accounts"
size="5"
ng-options="accounts.name for acount in selectedStudent.accounts track by account.id"
>
</select>
長話短說...它工作得很好,在頁面上...它顯示了所有我需要的數據...但第一個空行選擇(它的藍色,而其他人都是灰色(禁用))......像下面的例子:
帳戶:
row0 (selected and empty)
row1 (real data in it, and disabled)
row2 (real data in it, and disabled)
row3 (real data in it, and disabled)
現在我需要擺脫第一行的...它不應該在那裏... 並沒有什麼應該選擇...
有什麼建議嗎?
下面是一些數據:
$scope.selectedStudent = {};
$scope.selectedStudent = student;
和學生:
他有身份證,名字和姓氏,還有的BankAccount
@OneToMany(cascade = { CascadeType.ALL})
private Set<BankAccount> accounts;
public Student() {
accounts= new HashSet<BankAccount>();
}
你想要默認的選擇選項嗎? – Chetan
不,我只想顯示數據...並且必須全部禁用 – newbie
您能共享selectedStudent.accounts的json格式嗎請 – Chetan