我是Extjs和java腳本的新手。我有一個帶有3個文本字段的簡單表單。提交時,我想在下一頁(結果頁)上進行。當我點擊提交按鈕,我看到警報1,但沒有得到警報2和3.我確實看到響應回來在螢火蟲,但結果頁面沒有得到加載。我在這裏做錯了什麼,如何加載下一頁?任何幫助將不勝感激。ExtJs 4表格提交問題
Ext.require([
'Ext.form.*'
]);
Ext.onReady(function() {
var formPanel = Ext.create('Ext.form.Panel', {
frame: true,
title: 'New Todo',
width: 340,
bodyPadding: 5,
url: 'result.html',
ajaxSubmit:false,
fieldDefaults: {
labelAlign: 'left',
labelWidth: 90,
anchor: '100%'
},
items: [{
xtype: 'textfield',
name: 'id22',
fieldLabel: 'id22',
value: ''
},{
xtype: 'textfield',
name: 'Summary',
fieldLabel: 'Summary',
value: ''
}, {
xtype: 'textareafield',
name: 'Description',
fieldLabel: 'Description',
value: ''
}],
// Reset and Submit buttons
buttons: [{
text: 'Submit',
formBind: true, //only enabled once the form is valid
disabled: true,
handler: function() {
var form = this.up('form').getForm();
alert("1");
form.submit({
//clientValidation: true,
url: 'result.html',
success: function(form, action) {
alert("2");
},
failure: function(form, action) {
alert("3");
}
});
}
}],
});
formPanel.render('form-todo');
});
下面的答案有幫助嗎? – dbrin