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);
        }
    

      

  • 相关阅读:
    linux 系统函数 basename和dirname
    写linux脚本你怎么能不知道位置参数!?
    Linux 使用中history 默认记录数不够用了?
    在C/C++中常用的符号
    java23种设计模式之一: 策略模式
    工作中用到的git命令
    注解@Aspect实现AOP功能
    AOP 面向切面 记录请求接口的日志
    javaWeb导出POI创建的多个excel的压缩文件
    nginx的重试机制以及nginx常用的超时配置说明
  • 原文地址:https://www.cnblogs.com/lhlong/p/6862248.html
Copyright © 2011-2022 走看看