zoukankan      html  css  js  c++  java
  • ExtJs 中获取 radiobutton 的值

    ExtJs中使用radiobutton,想在ExtJs本身代码中(注意,不是在后台喔)获取 radioButton 的值,居然发现很难,无从下手的感觉。后来在网上寻寻觅觅,痛苦摸索之后,真是大跌眼镜。

    代码如下:

    {
        xtype: 'fieldcontainer', layout: { type: 'column' }
        , items: [
                {
                    xtype: 'radiogroup', fieldLabel: '统计方式', id: 'rdTjType', name: 'TjType'
                    , columnWidth: 0.5
                    , items: [
                    { boxLabel: '按行政区域', name: 'TjType', inputValue: 'qhid', checked: true }
                    , { boxLabel: '按年份', name: 'TjType', inputValue: 'year' }
                ]
                    , listeners: {
                        'change': function (group, newV, oldV, e) {
    //看到没,获得radiobuttongroup的选中值,居然是属性“TjType”!这个属性并不是ExtJs固有的,而是根据我们设置的radiobutton的name来相应设置的。并不是什么newV.inputValue!真是匪夷所思
                            var type = newV.TjType;
                            setTongJiParam(type);
                        }
                    }
                }
        ]
    }

    ExtJs一般给人的感觉就是很笨重,界面好像也很难修改;它大包大揽,除了语法还是javascript + json,好多东西都需要开发者猛查资料才明白,更遑论这些匪夷所思的小地方了。疯狂。

  • 相关阅读:
    纸上谈兵:最短路径与贪婪算法
    “不给力啊,老湿!”:RSA加密与破解
    纸上谈兵:拓扑排序
    Homebrew 安装使用
    Servlet详解
    搭建SpringMVC
    设置IDEA智能感知支持Jsp内置对象
    素材网站
    常用单词
    常见异常
  • 原文地址:https://www.cnblogs.com/leftfist/p/6808788.html
Copyright © 2011-2022 走看看