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

      

  • 相关阅读:
    使用C#编写SqlHelper类
    编译器perspective oo 对象模型(1) 之 初窥c++对象模型
    浅谈 编译器 & 自然语言处理
    基于c#的角色扮演游戏设计与实现
    开源的EtherCAT Master简介
    如何在Windows中编译Linux Unix的代码(采用cygwin)?
    sql拼语句例子
    IOC介绍-手写一个简单的IOC
    protocalBuffer_java版详解(转thanks)
    ProtocalBuffer_数据结构(转thanks)
  • 原文地址:https://www.cnblogs.com/lhlong/p/6862248.html
Copyright © 2011-2022 走看看