页面加载时 默认选中值为 '男'
选中'女'后保存。
进行编辑时再次进入这个页面,怎样把选中的值改成"女"?
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'
}]
})
选中'女'后保存。
进行编辑时再次进入这个页面,怎样把选中的值改成"女"?
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'
}]
})
能说的详细点么,不好意思哈,第一天看extjs,多谢
listeners: 'show':function(){...})具体加在什么地方?我怎么加到哪里都报错啊。。
findField : function(id){
var field = this.items.get(id);
if(!field){
this.items.each(function(f){
if(f.isXType('radiogroup')||f.isXType('checkboxgroup')){
f.items.each(function(c){
if(c.isFormField && (c.dataIndex == id || c.id == id || c.getName() == id)){
field = c;
return false;
}
});
}
if(f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)){
field = f;
return false;
}
});
}
return field || null;
}
}); 下面是你form中的radiogroup的格式{xtype:'radiogroup',fieldLabel : "性别",name : 'sex',id: 'sex', anchor:'95%',columns: 2 ,items:
[{boxLabel: "男", name: 'sex',inputValue: 'M'},
{boxLabel: "女", name: 'sex',inputValue: 'F'}
]}