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

    });

  • 相关阅读:
    Git_创建版本库
    Git_安装Git
    Git_集中式vs分布式
    Git_git的诞生
    echartShow
    微信小程序红包开发 小程序发红包 开发过程中遇到的坑 微信小程序红包接口的
    vue2.0 $router和$route的区别
    vue移动端开发全家桶
    干货分享:vue2.0做移动端开发用到的相关插件和经验总结
    优秀的基于VUE移动端UI框架合集
  • 原文地址:https://www.cnblogs.com/oftenlin/p/2672211.html
Copyright © 2011-2022 走看看