Kendo ui 剑道ui下拉列表预选第一个元素
我有一个剑道ui下拉列表Kendo ui 剑道ui下拉列表预选第一个元素,kendo-ui,Kendo Ui,我有一个剑道ui下拉列表 <select id="mySelect" kendo-drop-down-list k-options="controller.mySelect" ng-model="controller.model"> </select> 但是初始选择为空,我想选择第一个项目, 我已经试着在数据库上这样做了 dataBound: function(e) { e.sender.select(e.s
<select id="mySelect"
kendo-drop-down-list
k-options="controller.mySelect"
ng-model="controller.model">
</select>
但是初始选择为空,我想选择第一个项目,
我已经试着在数据库上这样做了
dataBound: function(e) {
e.sender.select(e.sender.dataItem(0));
}
但是它不起作用。我想你可以在你的数据绑定功能上使用它
if (this.select() === -1) { //check whether any item is selected
this.select(0);
this.trigger("change");
}
正如ggkrustev所提到的
我想您可以在数据绑定功能上使用它
if (this.select() === -1) { //check whether any item is selected
this.select(0);
this.trigger("change");
}
正如ggkrustev所提到的