问题描述
- ext formpanel submit 提交,后台接收不到数据怎么回事
-
var sysversionWindow = new Ext.Window({
title : '添加窗口',
width:500,
height:380,
closeAction:'hide',
modal : true,
layout : 'fit',
buttonAlign : 'center',
items : [sysversionFrom],
buttons : [{
text : '保存',
handler : function() {
var fileName = sysversionFrom.getForm().findField("cDownloadUrl").getValue();
if (fileName.lastIndexOf(".")!=-1) {
var fileType = (fileName.substring(fileName.lastIndexOf(".")+1,fileName.length)).toLowerCase();
var suppotFile = new Array();
suppotFile[0] = "apk";
suppotFile[1] = "ios";
var msg = true;for (var i =0;i<suppotFile.length;i++) {
if (suppotFile[i]==fileType) {
msg=false;
break;
} else{
continue;
}}
if(msg){
Ext.Msg.alert('温馨提示','文件格式不正确!应该为apk或者ios');return;
}
}
if (sysversionFrom.getForm().isValid()) {
sysversionFrom.getForm().submit({
url : "Sysversion_saveOrUpdateSysversion.do",
method : "POST",//文件上传必须设置成 post 请求
enctype : "multipart/form-data",//这也是文件上传必须设置的
waitTitle : '提交',
waitMsg : '正在保存数据,稍后...',
success : function(form, action) {
Ext.Msg.alert('信息提示',action.result.message);
sysversionWindow.hide();
store.reload();
},
failure : function(form, action) {
if(action.result.errors){
Ext.Msg.alert('信息提示',action.result.errors);
}else{
Ext.Msg.alert('信息提示','连接失败');
}
}
});
}
}
}, {
text : '取消',
handler : function() {
sysversionWindow.hide();
}
}]
});
解决方案
http://blog.csdn.net/southcamel/article/details/7560320