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,好多东西都需要开发者猛查资料才明白,更遑论这些匪夷所思的小地方了。疯狂。

转载于:https://www.cnblogs.com/leftfist/p/6808788.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值