// 加载完成后自动查询
$(function () {
doSearch();
$("#e_DWID").combobox({
onChange: function (n, o) {
$.ajax({
url: "../TreeHandler/TreeHandler.ashx?type=PartInfo&dwid=" + n,
type: 'post',
async: true, //默认为true 异步
onSubmit: function () {
//进行表单验证
//如果返回false阻止提交
//return $(this).form('enableValidation').form('validate');
},
success: function (data) {
if (data == "need login") {
location.href = getLoginUrl();
return;
}
$("#e_PartID").combobox("clear");
$("#e_PartID").combobox({
valueField: 'id',
textField: 'text',
panelHeight: "auto",
data: $.parseJSON(data)
});
}
});
}
});
});
EasyUI 里面的combobox是通过css替换并修饰效果的,无法直接使用onchange事件,需要如上进行事件注册。
试过官方demo的reload方法,不好用,还是如上重新绑定好了。