0
我對sencha touch很新,我想知道如何發送post數據。我現在面臨兩個問題。 1)我一直在獲取Uncaught TypeError:undefined不是函數,當我嘗試獲取表單數據時,以及2)如何將數據發佈到codeigniter中的遠程restful api。Sencha touch 2,Uncaught TypeError:undefined不是函數
我控制器現在給我的錯誤
Ext.define('tileconmob.controller.Main',{
extend:'Ext.app.Controller',
views:['Home','Address','Workers','Firstpage'],
models:['People','Worker'],
config:{
refs:{
loginForm:'#loginform'
},
control:{
'button[action=loginUser]':{
tap:'LoginUser'
}
}
},
LoginUser:function(button,event){
console.log("event in controller was fired");
//console.log(this.referenceList);
var values=this.getloginForm().getValues();
console.log(values);}
});
認爲
Ext.define('tileconmob.view.Home', {
extend: 'Ext.Panel',
xtype: 'profilepanel',
config: {
title: 'About us',
iconCls: 'home',
styleHtmlContent: true,
scrollable: true,
items: [{docked: 'top',
xtype: 'titlebar',
title: 'Login'},
{
xtype: 'fieldset',
title: 'About You',
id:'loginform',
items: [{
xtype: 'textfield',
name: 'name',
label: 'Full Name'
},
{
xtype: 'textfield',
name: 'password',
label: 'Password'
},
{
xtype:'button',
ui:'submit',
text:'Login',
action:'loginUser'
}
]
}]
}
});
這個代碼進一步合作,這是假設把數據上傳到遠程服務器笨REST API運行。希望某種靈魂可以讓我看到從這裏出發的路。