您的位置:首页 > 产品设计 > UI/UE

ExtJS3.4.0 radioGroup,checkboxgroup 在 getForm().getValues()取值问题的解决方案

2012-12-25 20:23 351 查看
var ChoicePanel = Ext.extend(Ext.FormPanel, {
    initComponent: function () {
        Ext.apply(this, {
            layout: 'form',
            items: [ 
                    { xtype: 'label', text: '网址请求方式' },
                    {
                        xtype: 'radiogroup', id: 'RequestMethod', vertical: true,
                        items: [
                            { boxLabel: 'GET', name: 'RequestMethod',  inputValue : 'GET', checked: true },
                            { boxLabel: 'POST', name: 'RequestMethod',  inputValue : 'POST' }
                        ]
                    }
            ]
        });
        ChoicePanel.superclass.initComponent.call(this);
    },
    getUserInfo: function () {
        var f = this.getForm();
        debugger;
        return f.getValues();
    } 

});


使用方法.

alert(new ChoicePanel().getUserInfo().RequestMethod)



注意是inputValue

radiogroup

每个 子项的值是inputValue,而不是value;

Extjs3.4.0适用
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: