radioGroup监听

来源:互联网 发布:淘宝添加客服的代码 编辑:程序博客网 时间:2024/05/01 22:18

radioGroup监听

  字号: 订阅

       //选择公历/农历radiogroup
        var calendar = new Ext.form.RadioGroup({
            fieldLabel: '历法'
            ,allowBlank: false
            ,items: [
                {
                    boxLabel: '公历'
                    ,name: 'blunar'
                    ,inputValue: 0
                    ,checked: true
                    ,listeners: {
                        check: function(field,checked){
                            if(checked){
                                //隐藏农历日
                                hideField(form.getForm().findField('luday'));
                                //隐藏农历月*闰月
                                hideField(form.getForm().findField('lumonth'));
                                hideField(form.getForm().findField('leapmonth'));
                                //显示公历日
                                showField(form.getForm().findField('solarday'));
                            }
                        }
                    }
                }
                ,{
                    boxLabel: '农历'
                    ,name: 'blunar'
                    ,inputValue: 1
                    ,listeners: {
                        check: function(field,checked){
                            if(checked){
                                //隐藏公历日
                                hideField(form.getForm().findField('solarday'));
                                //显示农历日
                                showField(form.getForm().findField('luday'));
                                //显示农历月*闰月
                                showField(form.getForm().findField('lumonth'));
                                showField(form.getForm().findField('leapmonth'));
                            }
                        }
                    }
                }
            ]

原创粉丝点击