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