现在的位置: 首页 > 综合 > 正文

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

2013年10月05日 ⁄ 综合 ⁄ 共 570字 ⁄ 字号 评论关闭

 

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适用

抱歉!评论已关闭.