PersonInfoFormPanel=Ext.extend(Ext.form.FormPanel,{
constructor:function(_config){
var _readOnly=false;
if(_config!=null){
if(_config.readOnly!=null){
_readOnly=_config.readOnly;
}
}
_config=Ext.apply({
defaultType:"textfield",
labelWidth:50,
baseCls:"x-plain",
defaults:{
anchor:"95%"
},
items:[{
fieldLabel:"姓名",
name:"name",
readOnly:_readOnly
},{
fieldLabel:"性别",
name:"age",
vtype:"age",
readOnly:_readOnly
},{
xtype:"combo",
fieldLabel:"年龄",
hiddenName:"sex",
value:"男",
disabled:_readOnly,
store:new Ext.data.JsonStore({
data:[{sex:"男"},{sex:"女"}],
fields:[{
name:"sex"
}]
}),
displayField:"sex",
mode:"local",
triggerAction:"all"
}]
},_config);
PersonInfoFormPanel.superclass.constructor.call(this,_config);
},
submit:function(){
[color=red]this.getForm().submit({
url:this.url
});[/color] },
getValues:function(){
if(this.getForm().isValid()){
return new Ext.data.Record(this.getForm().getValues());
}else{
throw Error("错误方法");
}
},
setValues:function(_r){
this.getForm().loadRecord(_r);
},
reset:function(){
this.getForm().reset();
}
});
红色的代码提交到后台得不到,可以判断name和age可以取到,但是值取不到,sex的默认值可以取到,为什么呢?