Extjs 表单未提交其值
我有一个创建表单的函数,但该表单未提交其值,出了什么问题?
它提交空的 ajax,如果我将第三行更改为 applyTo:document.body
它工作正常。
(tab
变量是表单需要位于其上的选项卡面板)
function myFunction(tab) {
var frm = new Ext.form.FormPanel({
applyTo: tab.id,
height: 250,
id: 'frm',
name: 'frm',
layout: 'form',
width: 520,
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();
}
}]
});
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 to applyTo: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: 520,
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();
}
}]
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在“text:'Submit'”之后设置“scope: this”或在处理程序函数中尝试:
Try setting "scope: this" after "text:'Submit'" or try inside your handler function:
您的
method
配置应为method : 'POST'
。POST
区分大小写。Your
method
config should bemethod : 'POST'
. ThePOST
is case sensitive.