不多说了直接上代码,看了就明白来
new Ext.form.RadioGroup({ name:'selectsex', id:'selectsex', fieldLabel:'select', hideLabel:true, columns:2, vertical:false, items:[{ boxLabel:'男',inputValue:'1',name:'sex',checked:true },{ boxLabel:'女',inputValue:'0',name:'sex' }] })
这里在Form中定义了RadioGroup
之后可以利用以下代码获取Radio的值(inputValue)
var sex=Ext.getCmp('selectsex'); sex.eachItem(function(item){ if(item.checked===true){ alert(item.inputValue); } });
ok!就这样取值成功!