不多说了直接上代码,看了就明白来
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!就这样取值成功!
本文展示了如何使用ExtJS创建RadioGroup,并提供了具体的代码实例。通过该示例,读者可以了解到如何定义RadioGroup及其属性,以及如何获取用户选择的值。
1330

被折叠的 条评论
为什么被折叠?



