继checkBoxGroup之后的radioGroup取值和赋值问题

1、radioGroup取值

如图为RradioGroup
代码如下:
{
xtype: 'radiogroup',
// width: 170,
text: '审核',
id:'verifyResult',
x: 255,
y: 695,
items: [
{
xtype: 'radiofield',
boxLabel: '同意',
id:'verifyResultYes',
checked:true,
inputValue:'true',
name:'auditResult'
},
{
xtype: 'radiofield',
boxLabel: '不同意',
id:'verifyResultNo',
inputValue:'false',
name:'auditResult'
}
]
},
其中inputValue可以根据需要设置
verifyResult = Ext.getCmp("verifyResult").getChecked()[0].inputValue;
因为radioGroup为单选框,所以在执行getChecked()方法后我们只需要取其中的数组的第一个元素即可获得radioGroup的inputValue
2、赋值
我们假设后台传递的是radioGroup的inputValue值,那么我们可以采取如下的赋值方法
其中auditResult为RadioGroup的name值。
var value = inputValue
Ext.getCmp("verifyResult").setValue({
auditResult: [value]
});
这样即可以给radiogroup赋值!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值