代码语言:javascript复制
<select id="hdprovinceId" class="easyui-combobox" name="hdprovinceId" style="width:100px;"
data-options="
editable:false,
valueField:'ID',
textField:'TEXT',
url:'<%=basePath%>getProvince',
onSelect: function(rec){
getCity(rec)
}
">
</select>
<select id="hdcityId" class="easyui-combobox" name="hdcityId" style="width:100px;"
data-options="
editable:false,
valueField:'ID',
textField:'TEXT',
onSelect: function(rec){
getDistrict(rec)
}
">
</select>
<select id="hddistrictId" class="easyui-combobox" name="hddistrictId" style="width:100px;" data-options="editable:false,valueField:'ID',textField:'TEXT'">
</select>
<%--获取市 --%>
function getCity(rec){
var url = '<%=basePath%>getCity?id=' rec.ID;
$('#hdcityId').combobox('loadData', []);
$('#hddistrictId').combobox('loadData',[]);
$('#hdcityId').combobox('reload', url);
$('#hdcityId').combobox('clear');
$('#hddistrictId').combobox('clear');
}
<%--获取区 --%>
function getDistrict(rec){
var url = '<%=basePath%>getDistrict?cityId=' rec.ID;
$('#hddistrictId').combobox('loadData',[]);
$('#hddistrictId').combobox('reload', url);
$('#hddistrictId').combobox('clear');
}