Border邊框布局


  Ext.layout.container.Border對應面板布局layout配置項的名稱為Border,該布局包含多個子面板,是一個面向應用的UI風格的布局,它將整個容器分為5個部分,分別是:east(東)、south(南)、west(西)、north(北)和center(中)。加入到容器中的子面板需要指定region配置項來告知容器要加入到那個部分。

  代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Ext.layout.container.Border示例</title>
    <link href="ext-4.0.7-gpl/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
    <script src="ext-4.0.7-gpl/bootstrap.js" type="text/javascript"></script>
    <script type="text/javascript">
        Ext.onReady(function () {
            Ext.create("Ext.panel.Panel", {
                title: "Ext.layout.container.Border示例",
                frame: true,
                width: 500,
                height: 300,
                renderTo: Ext.getBody(),
                bodyPadding: 5,
                layout: "border",
                defaults: {
                    collapsible: true
                },
                items: [{
                    title: "north panel",
                    html: "",
                    region: "north",
                    height: 50
                }, {
                    title: "south panel",
                    html: "",
                    region: "south",
                    height: 50
                }, {
                    title: "west panel",
                    html: "",
                    region: "west",
                    width:100
                }, {
                    title: "east panel",
                    html: "",
                    region: "east",
                    width: 100
                }, {
                    title: "center panel",
                    html: "",
                    region: "center"
                }]
            });
        });
    </script>
</head>
<body>
</body>
</html>

  效果圖:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM