zoukankan      html  css  js  c++  java
  • Extjs RadioBox 单选

    // 两个radio 只是显示,两个具有互斥性,触发事件时给一个隐藏字段赋值,后台读取隐藏字段,肯定不是最优,望高手拍砖

    this.cntRadio = new Ext.form.Radio({
            id: 'cntRadioId',
            boxLabel: '数量',
            inputValue: 'cnt',
            listeners: {
                'check': function() {
                    //alert(this.getValue());
                    if (this.getValue()) {
                        Ext.getCmp('moneyRadioId').setValue(false);
                        this.setValue(true);
                        Ext.getCmp('aresultType').setValue('cnt');
                    }
                }
            }
    });
     this.moneyRadio = new Ext.form.Radio({
            id: 'moneyRadioId',
            boxLabel: '总投资',
            inputValue: 'money',
            listeners: {
                'check': function() {
                    if (this.getValue()) {
                        Ext.getCmp('cntRadioId').setValue(false);
                        this.setValue(true);
                        Ext.getCmp('aresultType').setValue('totalMoney');
                    }
                }
            }
    });

     this.formPanel = new Ext.form.FormPanel({
          baseCls: 'x-plain',
          frame: false,
          id: id,
          bodyStyle: 'padding:5px 12px',
          url: 'Station.aspx?ac=Analysis',
          items: [{
                    xtype: 'hidden',
                    id: 'agroupType',
                    value: 'country'
                }, {
                    xtype: 'radiogroup',
                    fieldLabel: '统计结果',
                    id: 'resultRadio',
                    items: [
                        this.cntRadio, this.moneyRadio
                    ]
              }]

    });

  • 相关阅读:
    SQL Server 2008 Windows身份验证改为混合模式身份验证
    SQL中给datetime类型变量赋值
    结婚三周年特此@Mark一下
    搞笑的【国庆出游五大注意事项】
    利用SVNListParentPath增加http浏览仓库根目录的功能
    如果年底买不到CC就出手小指吧
    svn备份策略
    缺乏配置管理造成的常见问题
    高速公路开车必看的注意事项
    山雨欲来踏上Java学习之路
  • 原文地址:https://www.cnblogs.com/oftenlin/p/2672211.html
Copyright © 2011-2022 走看看