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

来源:互联网 发布:bilibili mac客户端 编辑:程序博客网 时间:2024/06/11 12:26
{                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;        }    });