码迷,mamicode.com
首页 > Windows程序 > 详细

ExtJS让被遮盖的窗体显示在最前面以及解决Ext.MessageBox提示框被TabPanel覆盖的方法【转】

时间:2016-01-27 17:12:15      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

ExtJS让被遮盖的窗体显示在最前面以及解决Ext.MessageBox提示框被TabPanel覆盖的方法
本文由发表于5年前 | Javascript | 暂无评论 |  被围观 14,752 views+

一、如何让ExtJS的弹出提示信息框Ext.MessageBox或者创建的Ext.Window显示在最前面:

下面是显示一个Window的JS代码:

var formPanel = MisTab1.createAddFormPanel();
var addWin = new Ext.Window({  
    title: "添加产品类别", 
    pageX: 50,
    pageY: 50,
    width: 600,  
    height: 200,  
    plain: true, 
    resizable: false,  	    
    collapsible: true,   
    closeAction: ‘close‘,  
    closable: true,
    modal: ‘true‘,  
    buttonAlign: "center",
    bodyStyle: "padding:20px 0 0 0",
    alwaysOnTop: true,
    items: [formPanel],  
    buttons: [{  
           text: "添 加",  
           minWidth: 70,  
           handler: function() {                
           }  
       }, {  
           text: "关 闭",  
           minWidth: 70,  
           handler: function() { 
           }  
       }]    
});	
addWin.show();

效果如图:

技术分享

想要让Window显示在最前面,只要创建一个WindowGroup管理创建的Window即可,需要添加的代码如下:

var tab1GroupMgr = new Ext.WindowGroup();  
//前置窗口
tab1GroupMgr.zseed=99999;  

var addWin = new Ext.Window({  
    title: "添加产品类别", 
    pageX: 50,
    pageY: 50,
    width: 600,  
    height: 200,  
    plain: true,
    manager: tab1GroupMgr,
...

技术分享

二、ExtJS弹出提示信息框Ext.MessageBox或者创建的Ext.Window被Ext.TabPanel覆盖的解决方法

出现这种原因可能是因为TabPanel设置了floating:true配置项。

floating : Boolean
True表示为浮动此面板(带有自动填充和投影的绝对定位),false...
True表示为浮动此面板(带有自动填充和投影的绝对定位),false表示为在其渲染的位置"就近"显示(默认为false)。True to float this Panel (absolute position it with automatic shimming and shadow), false to display it inline where it is rendered (defaults to false).

解决方法就是把设置的floationg:true配置项去掉:

var tabPanel = new Ext.TabPanel({
	region: ‘center‘,
	activeTab:0,
	shadow: true,
	floating: true,    //去掉该配置项
	items: [{
		title: ‘欢迎页面‘
	}]
});
除了文章中有特别说明,均为IT宅原创文章,转载请以链接形式注明出处。
本文链接:http://www.itzhai.com/extjs-form-to-be-displayed-on-the-front-cover-and-solve-ext-messagebox-boxes-are-covered-by-the-method-tabpanel.html
关键字: 
技术分享
arthinking指弹吉他 && 技术more

 

ExtJS让被遮盖的窗体显示在最前面以及解决Ext.MessageBox提示框被TabPanel覆盖的方法【转】

标签:

原文地址:http://www.cnblogs.com/linruiyi2015/p/5163680.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!