一、有时java工程中会用到easyui多级联动
<td align="right">一级:</td>
<td>
<input id="gardenCombox" class="easyui-combobox" />
<input id="garden" name="garden" qr="garden" required="true" type="hidden" class="queryRequired" />
</td>
<td align="right" >二级:</td>
<td>
<input id="gardenApprovalTypeCombox" class="easyui-combobox" />
<input id="typeId" name="typeId" qr="typeId" required="true" type="hidden" class="queryRequired" />
</td>
$('#gardenCombox').combobox({
url: "",
editable:false,
valueField:'hid',
textField:'hotRegion',
panelHeight:'auto',
onSelect : function(data){
$('#garden').val(data.hid);
//查询类型
$('#typeId').val('');
$('#gardenApprovalTypeCombox').combobox({
url: "",
editable:false,
valueField:'tid',
textField:'typeName',
panelHeight:'auto',
width:100,
}).combobox('clear');
}
});
//查询类型
$('#gardenApprovalTypeCombox').combobox({
url: "",
editable:false,
valueField:'tid',
textField:'typeName',
panelHeight:'auto',
width:100,
onSelect : function(data){
$('#typeId').val(data.tid);
}
});
在用的时候注意:1、有时<pre name="code" class="html">.combobox('clear')不知道为啥不太好使。所以只有将具体的值变为空:<pre name="code" class="html">$('#typeId').val('');