Extjs form not submitting its values
I have this function that creates a form and the form not submitti its values, what is wrong?
It submits empty ajax, If I change the third line toapplyTo:document.body
it works fine.
(the tab
variable is a tab panel that the form needs to be on it)
function myFunction(tab) {
var frm = new Ext.form.FormPanel({
applyTo: tab.id,
height: 250,
id: 'frm',
name: 'frm',
layout: 'form',
width: 开发者_如何学JAVA520,
url: 'operation/DataManipulator/',
method: "post",
labelWidth: 200,
items: [{
xtype: 'textfield',
name: 'users',
id: "users",
fieldLabel: 'How many users to create?'
}],
buttons: [{
text: 'Submit',
handler: function (btn, evt) {
frm.getForm().submit();
}
}]
});
Try setting "scope: this" after "text:'Submit'" or try inside your handler function:
function(btn, evt) {
Ext.getCmp('frm').getForm().submit();
}
Your method
config should be method : 'POST'
. The POST
is case sensitive.
精彩评论