iteye_6151 2010-10-26 10:55
浏览 266
已采纳

Extjs中formpanel提交问题

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的默认值可以取到,为什么呢?

  • 写回答

1条回答 默认 最新

  • lizhiyezi 2010-10-26 11:12
    关注

    红色代码没什么问题,你是后台 获取不到 name age 值?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持