我在提交此表单时遇到问题。当我单击提交按钮时,它显示 Uncaught TypeError: Object [object Object] has no method 'submit' 错误。
submitcontactform :function()
{
var form= this.getLoginform();
form.submit({
url:'contact.php'
});
}
提前致谢
编辑:
我的 login.js
Ext.define('sencha.view.Login',{
extend:'Ext.Panel',
xtype:'LoginPanel',
id:'loginform',
config:{
title:'LoginForm',
items: [
{
xtype: 'emailfield',
name : 'email',
label: 'Email'
},
{
xtype: 'passwordfield',
name : 'password',
label: 'Password'
},
{
xtype:'button',
text:'Submit',
ui:'confirm',
action:'submitForm'
}
]
}
});
我的控制器
Ext.define('sencha.controller.main',{
extend:'Ext.app.Controller',
views :['MainView','Login'],
config:
{
refs:
{
loginform:'#loginform'
//selector:'#buttonform'
}
},
init: function(){
this.control({
'button[action=submitForm]':{
tap:'submitcontactform'
}
});
},
submitcontactform :function(btn)
{
//console.log('im a function');
//var form= this.getLoginform();
var form=btn.up('formpanel');
form.submit({
url:'contact.php'
});
}
});
和我的 app.js
Ext.application({
name:'sencha',
controllers : ['main'],
views :['MainView','Login',''],
//stores: ['presidentstore'],
//models: ['presidentmodel'],
launch:function(){
Ext.create('sencha.view.MainView');
//Ext.Viewport.add({
// xclass:'sencha.view.presidentlist'
//});
}
});