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
                    ]
              }]

    });

  • 相关阅读:
    修改iptables防火墙规则解决vsftp登录后不显示文件目录的问题
    error: Refusing to undefine while domain managed save image exists
    linux 禁止ping
    Android图片加载框架Picasso最全使用教程3
    Android图片加载框架Picasso最全使用教程2
    Android图片加载框架Picasso最全使用教程1
    Android studio怎么修改文件名
    Android_Kotlin 代码学习
    Android Studio设置行宽、格式化断行
    使用Kotlin进行Android开发
  • 原文地址:https://www.cnblogs.com/oftenlin/p/2672211.html
Copyright © 2011-2022 走看看