zoukankan      html  css  js  c++  java
  • ExtJS让被遮盖的窗体显示在最前面以及解决Ext.MessageBox提示框被TabPanel覆盖的方法【转】

    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,
         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,
         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
  • 相关阅读:
    [CF1398A-E] Codeforces Round 93
    bzoj3758 数数和bzoj3798 特殊的质数
    P4234 最小差值生成树
    [UOJ274] P6664 温暖会指引我们前行
    P4172 [WC2006]水管局长
    bzoj2959 长跑
    bzoj4998 星球联盟(lct+并查集维护动态双连通性)
    P1501 [国家集训队]Tree II
    link-cut-tree
    fhq-treap,splay 模板
  • 原文地址:https://www.cnblogs.com/linruiyi2015/p/5163680.html
Copyright © 2011-2022 走看看