• EasyUI combobox 三级联动


    <script type="text/javascript">

      $(function(){
       loadqsfCombobox();
      });

    function loadqsfCombobox(){
        $('#bigArea').combobox({
            url:'/ydmsy/actions/area_base/getDSFData.do?actionId=ydmsy_area_base_getDSFData',    
            prompt : '输入空格或关键字后自动搜索',
            valueField:'bigArea',    
            textField:'bigArea',
            filter: function(q, row){
                var opts = $(this).combobox('options');
                return row[opts.textField].indexOf(q) >-1;
            },
            onSelect:function(rec){
                $("#province").combobox('clear');
                var url = "/ydmsy/actions/area_base/getDSFData.do?actionId=ydmsy_area_base_getDSFData&bigArea=" + rec.bigArea;
                $("#province").combobox('reload', url);
            },
            loadFilter:function(oData){
                var data = oData.data;
                for(var i in data){
                    data[i].bigArea = data[i].bigArea;
                }
                //data.unshift({"bigArea":"","bigArea":"请选择"});
                return data;
            }
        });
    $(
    '#province').combobox({ url:'', valueField:'provinceId', textField:'provinceName', filter: function(q, row){ var opts = $(this).combobox('options'); return row[opts.textField].indexOf(q) >-1; }, onSelect:function(rec){ $("#distribution").combobox('clear'); var url = "/ydmsy/actions/area_base/getDSFData.do?actionId=ydmsy_area_base_getDSFData&provinceId=" + rec.provinceId; $("#distribution").combobox('reload', url); }, loadFilter:function(oData){ var data = oData.data; //data.unshift({"provinceId":"","provinceName":"请选择"}); return data; } });
    $(
    '#distribution').combobox({ url:'', valueField:'bm', textField:'mc', filter: function(q, row){ var opts = $(this).combobox('options'); return row[opts.textField].indexOf(q) >-1; }, loadFilter:function(oData){ var data = oData.data; //data.unshift({"bm":"","mc":"请选择"}); return data; } }); }; </script>
    <body>
    <table>

    <tr>
    <td align="right">大区:</td>
    <td>
    <input type="text" id="bigArea" name="bigArea" class="easyui-combobox" style="220px;height:26px"/>
    </td>
    <td align="right">省:</td>
    <td>
    <input type="text" id="province" name="province" class="easyui-combobox" style="220px;height:26px"/>
    </td>
    <td align="right">分拨中心:</td>
    <td>
    <input type="text" id="distribution" name="distribution" class="easyui-combobox" style="220px;height:26px"/>
    </td>
    </tr> </table>

    </body>
  • 相关阅读:
    日期时间工具(dayjs)的使用
    Apache JMeter下载使用
    webpack 干货总结
    常见设计模式——模板方法
    常见设计模式——代理模式
    Codeforces Round #340 (Div. 2)E
    HDU 4547
    HDU 2586
    LCA算法的介绍与模板
    1073. 负二进制数相加
  • 原文地址:https://www.cnblogs.com/zlxbk/p/7120830.html
Copyright © 2020-2023  润新知