チュートリアルのパッチワークから構築したsenchatouchアプリケーションでフォームの値に到達しようとしています。MVCパターンアプリにしたいので、
app.views.Login = Ext.extend(Ext.form.FormPanel, formBase = {...})
そこの中でそれを初期化する
app.views.Login.superclass.initComponent.apply(this, arguments);
sencha touch phonegap MVCチュートリアル(リンク)のようなビューポートで、次のようなログインページを適用します
Ext.apply(app.views, {loginPage: new app.views.Login()});
アプリ内でフォームの送信ボタンをクリックすると、フォームのフィールドをキャッチしようとします
handler: function() {
console.log('username ', app.views.Login.getValues().username);
Ext.Ajax.request({
url: app.views.Login.url,
method: 'POST',
params: {username: form.getValues().username, password : form.getValues().password},
failure : function(response){
console.log('Login Error! ' + response.responseText);
},
success: function(response, opts) {
console.log('Login success! response: ' + response.responseText);
}
});
}
しかし、私はいつもエラーが発生します
Uncaught TypeError:undefinedのメソッド'getValues'を呼び出すことはできません "
私が使うとき
console.log('username ', this.getValues().username);
では、どうすればフォームの値に到達できますか?
thnx !!!