EasyUI combobox 下拉框联动问题
//获取设备1
function Getshebei1() {
$.ajax({
type: "POST",
url: "/ExMember/HuiYuanTongJi/CommonHandler.aspx",
dataType: "json",
data: { "opType": "commonSearch"}
success: function (data) {
if (data.success) {
var feiquarr = new Array();
feiquarr = data.rows;
$("#设备1").combobox({
data: feiquarr,
valueField: 'HangBiaoShi',
textField: 'MingCheng',
formatter: function (data) {
return"<a value=\"" + data.HangBiaoShi + "\" style=\"height:5px;\">" + data.MingCheng + "</a>";
},
onSelect: function (record) {
Getshebei1(record.HangBiaoShi);
}
});
}
else {
alert("错误 " + data.errormsg); //显@示º?错e误`信?息¡é
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("失败" + XMLHttpRequest.responseText);
}
});
}
//获取设备2
function Getshebei2(HangBiaoShi) {
if (HangBiaoShi == null || HangBiaoShi == undefined || $.trim(HangBiaoShi.toString()) == "") {
$("#设备2").combobox("clear");
return;
}
$.ajax({
type: "POST",
url: "/ExMember/HuiYuanTongJi/CommonHandler.aspx",
dataType: "json",
data: { "opType": "commonSearch1", "HangBiaoShi": HangBiaoShi},
success: function (data) {
if (data.success) {
var feiqumingxiarr = new Array();
feiqumingxiarr = data.rows;
$("#设备2").combobox({
data: feiqumingxiarr,
valueField: 'HangBiaoShi',
textField: 'MingCheng',
formatter: function (data) {
return"<a value=\"" + data.HangBiaoShi + "\" style=\"height:5px;\">" + data.MingCheng + "</a>";
}
});
}
else {
alert("错误: " + data.errormsg);
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("失败:" + XMLHttpRequest.responseText);
}
});
}