Extjs的Form表单提交方式
一.直接提交:url写在表单中
var addForm = new Ext.FormPanel({
frame: true,
url:"insertProject.eva?doType=insertProject",
labelWidth: 80,
//labelAlign: "right",
//buttonAlign:"center",
items:[
xmmcCombox,
{
name:"xmdw",
xtype:"textfield",
fieldLabel:"项目单位",
readOnly:true,
width:200
},{
name:"depart",
xtype:"textfield",
fieldLabel:"主管部门",
readOnly:true,
width:200
},
typeRadio,
modeRadio,
agencyRadio
],
buttons:[
{
text:"确认",
handler:function(){
addForm.getForm().submit({
method:"POST",
waitMsg:"保存中,请稍后..."
});
addWin.hide();
}
},{
text:"取消",
handler:function(){
addWin.hide();
}
}
]
});
二.在submit()方法中获取参数值,设置URL,并提交
var addForm = new Ext.FormPanel({
frame: true,
labelWidth: 80,
//labelAlign: "right",
//buttonAlign:"center",
items:[
xmmcCombox,
{
name:"xmdw",
xtype:"textfield",
fieldLabel:"项目单位",
readOnly:true,
width:200
},{
name:"depart",
xtype:"textfield",
fieldLabel:"主管部门",
readOnly:true,
width:200
},
typeRadio,
modeRadio,
agencyRadio
],
buttons:[
{
text:"确认",
handler:function(){
var thisForm = addForm.getForm();
if(this