【发布时间】:2014-03-17 13:10:31
【问题描述】:
我有一个包含两个 RadioGroups 的字段集,每个 RadioGroup 有两个 RadioFields:
xtype: 'fieldset',
title: 'Advanced',
autoHeight : true,
id : 'advancedfieldset',
collapsible : true,
width : 280,
margin : 5,
labelWidth : 280,
items : [
{ xtype : 'radiogroup',
name: 'myGroup',
vertical: true,
items :[
{
boxLabel : 'duplicate',
name:'1',
id:'hid_dup',
inputValue: 'Yes'
},
{
boxLabel : 'not duplicate',
name: '1',
id:'hid_not_dup',
inputValue: 'Yes'
}
]},
{xtype : 'radiogroup',
name: 'myGroup2',
vertical: true,
items :[{
boxLabel : 'state',
name: '2',
id:'hid_state',
inputValue: 'Yes'
},
{
boxLabel : 'not state',
name: '2',
id:'hid_not_state',
inputValue: 'Yes'
}
]
}
]
我想遍历字段集并返回每个无线电组的已检查无线电的inputvalue。
我喜欢这样:
var advancedFieldset = parametersRef.down('fieldset[id=advancedfieldset]');
advancedFieldset.items.each(function (item) {
if (item.xtype =='combo'){
filters_values_arr.push(item.getRawValue());
}else{
alert(parametersRef.getForm().getValues()[item.name]); //it gives me the two radiofields inputValue (although only one of them is checked) of the FIRST RADIO GROUP ONLY
alert(item.items.get(1).getGroupValue());//same here
}
});
但它不起作用,请帮助!
【问题讨论】:
标签: extjs radio-group