easyui二级联动

来源:互联网 发布:4g网络电话软件 编辑:程序博客网 时间:2024/06/14 15:55

一、有时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('');

0 0
原创粉丝点击