zoukankan      html  css  js  c++  java
  • easyui 绑定下拉框,下拉框选择改变事件的触发方法

    //①定义下拉框
     //离线公司【个人或公司】 下拉框
        var tmpComOrPer = {
            type: 'combobox',
            options: {
                onSelect:function(data) {
                    ComOrPerChange(false);
                },
                editable:false,
                panelHeight: 'auto',
                valueField: 'Type',
                textField: 'label',
                data: [ {
                    label: '@BaseRes.OSP_CTL_087',
                    Type: '0'
                }, {
                    label: '@BaseRes.OSP_CTL_088',
                    Type: '1'
                }],
                required: true
            }
    
        }
    
    //②绑定下拉框
    。。。。。
      {  align: 'center', field: 'ComOrPer', title: '@BaseRes.OSP_CTL_127',  65, editor: tmpComOrPer}
    。。。。。。
    

      

    选择事件

    onSelect:function(data) {
    ComOrPerChange(false);
    },

    datagrid 动态绑定下拉框

       function ComOrPerChange(bl) {
    
            var row =comdg.thisdg.datagrid('getSelected');
            var rowIndex = comdg.thisdg.datagrid('getRowIndex',row);//获取行号
            var target = comdg.thisdg.datagrid('getEditor', {'index':rowIndex,'field':'ReportType'}).target;
            var targetValue = target.combo("getValue");
            target.combobox('clear'); //清除原来的数据
    
            var targetComOrPer = comdg.thisdg.datagrid('getEditor', {'index':rowIndex,'field':'ComOrPer'}).target;
    
            if (targetComOrPer.combo("getValue") == "1") {
                target.combobox({data:[ {
                    label: '@BaseRes.OSP_CTL_100',
                    Type: '12'
                }, {
                    label: '@BaseRes.OSP_CTL_101',
                    Type: '13'
                }, {
                    label: '@BaseRes.OSP_CTL_102',
                    Type: '14'
                }]});
            } else {
                target.combobox({data:[ {
                    label: '@BaseRes.OSP_CTL_089',
                    Type: '0'
                }, {
                    label: '@BaseRes.OSP_CTL_090',
                    Type: '1'
                }, {
                    label: '@BaseRes.OSP_CTL_091',
                    Type: '2'
                }, {
                    label: '@BaseRes.OSP_CTL_092',
                    Type: '3'
                }, {
                    label: '@BaseRes.OSP_CTL_093',
                    Type: '4'
                }, {
                    label: '@BaseRes.OSP_CTL_094',
                    Type: '5'
                }, {
                    label: '@BaseRes.OSP_CTL_095',
                    Type: '6'
                }, {
                    label: '@BaseRes.OSP_CTL_096',
                    Type: '7'
                }, {
                    label: '@BaseRes.OSP_CTL_097',
                    Type: '8'
                }, {
                    label: '@BaseRes.OSP_CTL_098',
                    Type: '9'
                },{
                    label: '@BaseRes.OSP_CTL_171',
                    Type: '10'
                }, {
                    label: '@BaseRes.OSP_CTL_099',
                    Type: '11'
                }@*, {
                        label: '@BaseRes.OSP_CTL_100',
                        Type: '12'
                    }, {
                        label: '@BaseRes.OSP_CTL_101',
                        Type: '13'
                    }, {
                        label: '@BaseRes.OSP_CTL_102',
                        Type: '14'
                    }*@]});
            }
            if(bl)
                target.combobox("setValue", targetValue);
        }
    

      

  • 相关阅读:
    oracle数据比对工具
    一条update语句优化小记
    执行计划生成及查看的几种方法
    使用Grep命令查找 UTF-16的文本的注意事项
    命令行下更好显示 mysql 查询结果
    Zabbix通过SNMP监控多核CPU Load时,使用外部检查计算CPU Load的平均值。
    Hyper-V Cluster Clustered Role and Resource Properties and Live migration setting
    Python自动登录PRTG各节点,截取整个网页保存为图片
    添加Hpyer-V内存使用情况监控
    在Zabbix上添加Win DHCP Scope的监控
  • 原文地址:https://www.cnblogs.com/lhlong/p/6862248.html
Copyright © 2011-2022 走看看