修改Ext 3.3 Radio 的inputValue不能0的Bug

本文介绍了一个关于ExtJS框架中Radio Group控件的问题,当inputValue设置为0时,控件无法正常工作。文章提供了针对ExtJS 3.3.1版本的解决方案,通过重写Radio原型的方法来解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

{
                xtype: "radiogroup",
                fieldLabel: "分类",
                columns: 8,
                items: [{
                    boxLabel: "全部",
                    name: "launchType",
                    inputValue: "0"
                }, {
                    boxLabel: "服饰",
                    name: "launchType",
                    inputValue: "1"
                }, {
                    boxLabel: "鞋子",
                    name: "launchType",
                    inputValue: "2"
                }, {
                    boxLabel: "包包",
                    name: "launchType",
                    inputValue: "3"
                }]
            }

自己定义的这么一个radiogroup,结果始终点不动,也不报错,网上查了下,说是3.3有这个bug,inputValue为0会导致点不动,自己重写了下,版本3.3.1:

Ext.form.Radio.prototype.initComponent =
    Ext.form.Radio.prototype.initComponent.createInterceptor(function() {
        if ( this.inputValue === '0' ) {
            this.inputValue = 0;
        }
    });



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值