//如果是有代理商退货,会显示退货代理商和退货品牌
if(${type==2}){
var bid0 = $('#orderReturnForm').find('input[name=bid]');
var agencyid = $('#orderReturnForm').find('input[name=agencyid]');
var agencyidCombobox = agencyid.combobox({
url : '${pageContext.request.contextPath}/dls/agencyAction!noAuth_MyAgencyJson.html',
valueField : 'id',
textField : 'username',
multiple : false,
editable : false,
panelHeight : 'auto',
onSelect : function(){
var agencyvalue = agencyid.combobox("getValue");
var bid0Combobox = bid0.combobox({
url : '${pageContext.request.contextPath}/spgl/brandAction!noAuth_comboboxAgencyBrand.html?agencyid='+agencyvalue,
valueField : 'id',
textField : 'name',
multiple : true,
editable : true,
onLoadSuccess : function() {
parent.$.messager.progress('close');
}
});
$("#bid").combobox('showPanel');
}
});
}
以上代码实现的是combobox级联,如下图:
//判断仓库是否为空,如果为空则显示仓库下拉框;如果非空则把仓库给隐藏域
if($("#rid")!=null&&$("#rid").combobox("getValues")!=null&&$("#rid").combobox("getValues")!=""){
var rid = $("#rid").combobox("getValues");
$(".rid").attr("name","rid");
$(".rid").attr("value",rid);
}else{
//parent.sy.messagerConfirm('未选择退货仓库', '请选择要退货仓库!');
$("#rid").combobox('showPanel');
return;
}
//有代理商退货的情况
if(${type==2}){
//判断代理商是否为空,不为空则处理品牌,为空则显示代理商下拉框
if($("#agencyid")!=null&&$("#agencyid").combobox("getValues")!=null&&$("#agencyid").combobox("getValues")!=""){
if($("#bid")!=null&&$("#bid").combobox("getValues")!=null&&$("#bid").combobox("getValues")!=""){
var bid0 = $('#bid').combobox("getValues");
$(".bids").attr("name","bids");
$(".bids").attr("value",bid0);
}else{
$("#bid").combobox('showPanel');
return;
}
}else{
$("#agencyid").combobox('showPanel');
return;
}
}
以上代码实现提交前判断为空则显示下拉面板,如下图