Extjs中window隐藏后再打开fieldLabel显示多个

afei3418 2015-07-20 10:18:49
现在遇到一个这样的问题,window在hide之后,再打开,window页面中的fieldLabel显示多个
...全文
140 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
afei3418 2015-07-20
  • 打赏
  • 举报
回复
每次都是通过fileWin.hide() 已经包含 fieldLabel : "<font color='red'>*</font>附件" 、fieldLabel: '备注'
香蕉猪 2015-07-20
  • 打赏
  • 举报
回复
不想看那么长的代码。。。 是不是 fieldLabel : "<font color='red'>*</font>附件",没有被楼主hide掉???楼主检查进行了Hide的div框的范围。。。。
xujun5031 2015-07-20
  • 打赏
  • 举报
回复
这个我以前也碰到过,好像 要清一下什么东西,时间太长,不记得了
afei3418 2015-07-20
  • 打赏
  • 举报
回复
相关代码如下: //文件panel fileFormPanel = new Ext.form.FormPanel({ name : "fileFormPanel", id : "fileFormPanel", labelWidth : 70, defaultType : "textfield", baseCls : 'x-plain', bodyStyle : 'padding:5px 5px 0', width : 390, buttonAlign:'center', fileUpload: true, //loadMask : false, //maskDisabled: true, loadMask : new Ext.LoadMask(Ext.getBody(), { msg : '请稍候,正在查询....' }), waitMsg : '请稍候,正在查询....', onSubmit: Ext.emptyFn, border : false, defaults : { width : 230 }, items : [ { name : "file", id : "uploadFile", inputType : 'file', fieldLabel : "<font color='red'>*</font>附件", style :"margin:4px", height : 20, allowBlank : false, blankText : "附件不能为空", emptyText : "请选择附件..." } ,{ name : 'fileRemark', id : 'fileRemark', xtype : 'textarea', fieldLabel: '备注', collapsible : true, style : 'margin:4px;margin-bottom:10px;', width : 230, height: 100 }], buttons : [{ name : 'fileSureBtn', id : 'fileSureBtn', text : "确定", handler : function(){ if (!fileWin.getComponent('fileFormPanel').form.isValid()) { selInfo("请完整填写表单!"); return; } //取消遮罩 //fileFormPanel.getEl().mask('请稍后,正在上传附件……'); //进度框 Ext.Msg.wait('请稍后,正在上传附件……', '', {animate : true}); //var fileName = $('fileName').value; // var uploadFile = $('uploadFile').value; // var remark = $('fileRemark').value; var uploadFile = fileFormPanel.getForm().findField("uploadFile").getValue(); var remark = fileFormPanel.getForm().findField("fileRemark").getValue(); //当前节点对象 var row =grid.getSelectionModel().getSelected();//获取一行 var fId = row.get('FolderId'); var dId = row.get('DocId'); var file = dwr.util.getValue("uploadFile"); //构造参数对象 var parObj = { docId : dId, folderId : fId, fileCode : '', //附件编码先不做(预留字段) fileName : fileName, //文件的名称 uploadFile : uploadFile, //上传的文件全路径 userId : userId, remark : remark }; //调用DWR方法 FolderHandlerBean.createFile(file,parObj,function(data){ if(data.flag == '1'){ //隐藏窗口 Ext.getCmp('uploadFile').setValue(''); fileWin.hide(); //刷新grid // fileStore.load({ // window.location.reload(); // selOk(data.msg); Ext.MessageBox.show({ title : '提示', msg : '添加成功!', modal : true, buttons : Ext.Msg.OK, icon : Ext.Msg.INFO, width : 200, fn : function() { fileGrid.getStore().reload(); } }); }else{ Ext.getCmp('uploadFile').setValue(''); fileWin.hide(); // fileWin.close(); window.location.reload(); selError(data.msg); } }); } }, { text : "取消", handler : function() { //清除数据 //Ext.getCmp('fileName').setValue(''); Ext.getCmp('uploadFile').setValue(''); Ext.getCmp('fileRemark').setValue(''); //隐藏窗口 fileWin.hide(); } }] }); //文件窗口 fileWin = new Ext.Window({ id : "fileWin", title : "附件编辑", width : 360, height : 450, bodyStyle : 'padding:5px;', maximizable : false, closeAction : 'hide', // closeAction : 'close', closable : true, //是否关闭 collapsible : true, //是否可以收缩 draggable : true, //是否可以拖拽 resizable : false, //是否可以调整大小 modal : true, //是否遮罩(true的时候,后面的页面不能使用) buttonAlign : "center", items : fileFormPanel });
afei3418 2015-07-20
  • 打赏
  • 举报
回复

如图所示:
afei3418 2015-07-20
  • 打赏
  • 举报
回复
问题已解决 ,改成xtype:'fileuploadfield'形式上传

87,899

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧