码迷,mamicode.com
首页 > 其他好文 > 详细

easyui 绑定下拉框,下拉框选择改变事件的触发方法

时间:2017-05-16 17:32:23      阅读:1791      评论:0      收藏:0      [点我收藏+]

标签:style   定义   csharp   index   type   grid   var   har   hang   

//①定义下拉框
 //离线公司【个人或公司】 下拉框
    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‘, width: 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);
    }

  

easyui 绑定下拉框,下拉框选择改变事件的触发方法

标签:style   定义   csharp   index   type   grid   var   har   hang   

原文地址:http://www.cnblogs.com/lhlong/p/6862248.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!