Extjs 弹窗问题第一次每晚难题,但是上传以后再点开按钮有问题
extjs吧
全部回复
仅看楼主
level 1
Ext.namespace("info");
info.inputForm;
/**
* 弹出表单页面
*/
info.uploadExcel = function(params) {
if (!params) {
params = {};
}
var form = new Ext.form.FormPanel({
baseCls : 'x-plain',
labelWidth : 70,
labelHeight: 150,
fileUpload : true,
defaultType : 'textfield',
items : [{
xtype : 'textfield',
fieldLabel : '上传文件',
inputType : 'file',
name : 'file',
id:'file',
allowBlank : true,
anchor : '90%' ,
} ]
});
info.inputWin = new Ext.Window({
title : '上传Excel信息',
width : 400,
height : 150,
layout : 'form',
modal : true,
autoScroll : true,
iconCls : 'icon-user',
bodyStyle : 'padding:20px 20px 20px 20px;',
items:form,
buttons : [{
text : '确认上传',
handler : function() {
if (form.getForm().isValid()) {
if(Ext.getCmp('file').getValue().inputValue == ''){
Ext.Msg.alert('温馨提示','请选择需要上传的文件');
return;
}
Ext.MessageBox.show({
title : '请稍等....',
msg : '文件上传中....',
progressText : '',
width : 300,
progress : true,
closable : false,
animEl : 'loding'
});
form.getForm().submit({
url :basePath_ +'路径',
method : 'POST',
success : function(form, action) {
Ext.Msg.alert('成功','文件上传成功!');
info.inputWin.hide();
},
failure : function(form, action) {
Ext.Msg.alert('失败',"文件上传失败!");
}
});
}
}
}, /*{
text : '关闭',
handler : function() {
info.inputWin.hide();
}
}*/
],
/* closable: false,
draggable: false,
resizable: false */
});
info.inputWin.show();
};
2017年07月08日 08点07分 1
1