在我的表格中,放射线组看起来像这样
{
xtype: 'radiogroup',
vertical: false,
fieldLabel: ' ',
labelSeparator: ' ',
reference: 'radiofield',
val: 1,
items: [
{
boxLabel: 'Complete',
name: 'complete[20]',
inputValue: '1'
},
{
boxLabel: 'Incomplete',
name: 'complete[20]',
inputValue: '2'
}
]
}, {
xtype: 'radiogroup',
vertical: false,
fieldLabel: ' ',
labelSeparator: ' ',
reference: 'radiofield',
val: 2,
items: [
{
boxLabel: 'Complete',
name: 'complete[19]',
inputValue: '1'
},
{
boxLabel: 'Incomplete',
name: 'complete[19]',
inputValue: '2'
}
]
},在Load方法中,我像这样设置这些值
Ext.each(ids, function(id){
var g = mainPanel.down('radiogroup[val='+id+']');
var name = 'complete['+id+']';
g.setValue({name: 2});//the value can be either 1 or 2
});如何设置radiogroup的值?请注意,当我给它们硬编码值时,如下所示
g.setValue({'complete[19]': 2});它可以工作,任何解决方案
https://stackoverflow.com/questions/41484387
复制相似问题