社区
JavaScript
帖子详情
Extjs中window隐藏后再打开fieldLabel显示多个
afei3418
2015-07-20 10:18:49
现在遇到一个这样的问题,window在hide之后,再打开,window页面中的fieldLabel显示多个
...全文
137
6
打赏
收藏
Extjs中window隐藏后再打开fieldLabel显示多个
现在遇到一个这样的问题,window在hide之后,再打开,window页面中的fieldLabel显示多个
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用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'形式上传
Extjs
Window
用法详解
今天我们来介绍一下
Extjs
中
一个常用的控件
Window
。
Window
的作用是在页面
中
创建一个窗口,这个窗口作为容器,可以在它里面加入grid、form等控件,从而来实现更加复杂的界面逻辑。本文的示例代码适用于
Extjs
4.x和
Extjs
5.x,在
Extjs
4.2.1 和
Extjs
5.0.1
中
亲测可用!本文由齐飞(youring2@gmail.com)原创,并发布在http://www.q...
extjs
.处理动态
显示
隐藏
,必填,禁用
动态处理
显示
隐藏
,必填,禁用
【
ExtJs
】
ExtJs
的表单插件与表单布局、提交与验证
利用
ExtJs
的Anchor可以为
ExtJs
自带的表单Form各个组件进行布局,当然,使用《【
ExtJs
】带日期组件的文本输入框、容器与Ext.Msg.alert告警框告警两次》(点击
打开
链接)
中
的vbox也是可以的。其实
ExtJs
的表单插件与表单布局并不是关键,
ExtJs
的表单验证还好,就几行语句就能够完成。关键是
ExtJs
的表单提交必须通过Ajax方式,而在后台必须传回一个Json完成表单的提
ExtJs
window
备注
创建
Extjs
Window
创建
Extjs
Window
的代码如下: //创建
window
var win = Ext.create("Ext.
window
.
Window
", { id: "myWin", title: "示例窗口", width: 500, height: 300, layout: "fit", items: [
ExtJs
window
使用API以及
window
常用属性和方法
1.使用API xtype:组件的别名 Hierarchy 层次结构 Inherited mixins 混入的类 Requires 该组件需要使用的类 configs:组件的配置信息 properties:组件的属性 methods:组件的方法 events:组件的事件 2.
window
组件常用属性和方法讲解: configs: c
JavaScript
87,845
社区成员
224,617
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章