jQuery EasyUI Combobox 二级区域联动

01 $(function(){
02         var provinceId = $('#provinceId').combobox({
03             url:'${pageContext.request.contextPath}/region/province/json.htm',
04             editable:false,
05             valueField:'id',
06             textField:'name',
07             onSelect:function(record){
08                 //刷新数据,重新读取省份下的城市,并清空当前输入的值
09                 cityId.combobox({
10                     disabled:false,
11                     url:'${pageContext.request.contextPath}/region/city/'+record.id+'/json.htm',
12                     valueField:'id',
13                     textField:'name'
14                 }).combobox('clear');
15             }
16         });
17         var cityId = $('#cityId').combobox({
18             disabled:true,
19             url:'${pageContext.request.contextPath}/region/city/'+provinceId.val()+'/json.htm',
20             valueField:'id',
21             textField:'name'
22         });
23 });

你可能感兴趣的:(JAVASCRIPT,jquery)