EasyUI ComboBox默认值

时间:2020-12-17 19:43:02

combobox数据加载完后设置默认值

$('#ck').combobox({
url: '/External/GetAllCk',
valueField: 'Ddbh',
textField: 'Ddmc',
onLoadSuccess: function () { //加载完成后,设置选中第一项
var val = $(this).combobox("getData");
for (var item in val[0]) {
if (item == "Ddbh") {
$(this).combobox("select", val[0][item]);
}
}
}
});