• Ext中border方式时 region注意点


    在用region时有时候会出错,于是自己测试了下

    代码:

    Ext.onReady(function(){  
        var viewport = new Ext.Viewport({  
            layout:'border', 
    		//html: '<p>第二步,一共4步</p>',
            items:[{  
                region: 'north',  
                split: true, 
    			title:'north', 
    			//north, south, east, west or center)
                border: true  
            },{  
                region: 'west',  
                split: true, 
    			title:'west', 
                border: true  
            },{  
                region: 'center',  
                split: true, 
    			title:'center', 
                border: true  
            },{  
                region: 'east',  
                split: true, 
    			title:'east', 
                border: true  
            },{  
                region: 'south',  
                split: true, 
    			title:'south', 
                border: true  
            }]  
        });  
      
    }); 
    

      

    根据测试结果,可以看出center是不能为空的,其他的可以为空不设置。

    查看api,有以下资料:

    BorderLayout具有固定性,渲染之后就不会任意变动或改变格局。中央区域(center region)在BorderLayout设定中不可或缺。假使没有其它的区域,中央布局便会就是该布局的全部区域。
    The regions of a BorderLayout are fixed at render time and thereafter, no regions may be removed or added.The BorderLayout must have a center region, which will always fill the remaining space not used by the other regions in the layout. 

    总结:

    1.center是一定需要的。(如果Ext在没有center时也能定位就好了,希望他下个版本能解决)

    2.使用其他ide时(例如c#),是使用(top,left,right)之类来定位,感觉要比用方向更方便,毕竟更人性化,不需要想地图去(上北下南,左西右东)了。

  • 相关阅读:
    太忙了
    Delphi 的接口(2) 第一个例子
    Delphi 的接口(3) 关于接口的释放
    VS.NET让我做了一场恶梦
    [推荐阅读]The Best Of .The NET 1.x Years
    向大家说声对不起
    [致歉]16:30~17:10电信网络出现问题
    服务器恢复正常
    [SharePoint]更改活动目录(AD)中用户名的问题
    [正式决定]博客园开始接受捐助
  • 原文地址:https://www.cnblogs.com/malaya/p/3833228.html
Copyright © 2020-2023  润新知