2011-10-19 118 views
0

我正在提交表單,但神奇的是我的表單值不會發布。 的onBeforeSubmit火災與預期值,我甚至可以做this.getValues()只是this.submit()觸摸表單忽略提交的值

MyForm= function(config){ 
if (typeof config !== 'object') { 
config.url='test.php'; 
// config.standardSubmit = true; 
config.items= [{ 
    xtype: 'fieldset', 
    title: 'Login Details', 
    instructions: 'Please enter the information above.', 
    defaults: { 
     required: true,' 
    }, 
    items: [{ 
     xtype: 'textfield', 
     name : 'username' 
    }, { 
     xtype: 'passwordfield', 
     name : 'password' 
    }] 
}]; 
var tbarBottom = { 
    xtype: 'toolbar', 
    dock: 'bottom', 
    items: [{ 
     text: 'Login', 
     ui: 'confirm', 
     handler: function() { 
      this.onLoginClick(); 
     }, 
     scope: this 
    }] 
}; 
config.listeners= { 
    beforesubmit: function(formpanel, values, options) { 
    console.log(values);//yup they are there 

    }, 
    scope:this 
} 
config.dockedItems= [tbarBottom]; 

MyForm.superclass.constructor.call(this,config); 
}; 


Ext.extend(MyForm, Ext.form.FormPanel,{ 

onResetClick: function() { 
    this.reset() 
}, 
onLoginClick: function() { 
    console.log(this.getValues());//yup they are there 
    this.submit() 
} 

}); 

TL之前,DR這向服務器提交,但我被張貼任何值,你有什麼想法爲什麼?

回答