JQueryEasyUI學習筆記(六)

來源:互聯網
上載者:User

今天是這個Layout布局架構的基本使用:
layout就是一個布局面板:

也就是布局的容器,有五個布局地區:北部,南部,東部,西部和中心。其中中心地區面板是必需的,但中心地區面板邊緣地區面板是可選的。通過拖動它的邊框,面板,可以調整每一個邊緣地區。可以嵌套的布局,以便使用者可以建立複雜的布局。

 如果想要各個地區中的架構隨架構的大小改變,請嵌套到layout架構中;


<script type="text/javascript">
        //split屬性:如果設定為true將顯示一個分隔條,使用者可以拖動分隔條來改變布局面板的尺寸。
        //href屬性:在指定地區內載入頁面的body中的部分,其他不載入
        //在panel架構中我們可以看到這樣一個正則選擇(可根據自己需求變更):
        //        extractor: function (data) {
        //            var pattern = /<body[^>]*>((.|[\n\r])*)<\/body>/im;
        //            var matches = pattern.exec(data);
        //            if (matches) {
        //                return matches[1]; // only extract body content
        //            } else {
        //                return data;
        //            }
        //        }
        //panel屬性:返回特定的布局面板,'region'參數的可取值為:'north','south','east','west','center'。
        function getPanel() {
            var southPanel = $("#layoutbody").layout('panel', 'south');
            //獲得panel的屬性
            var attributes = southPanel.panel('options');
            console.info(attributes); //可以看到其中的各個屬性,瀏覽器調試,這裡說明下:使用這種架構和使用js自己書寫前台代碼,瀏覽器調試是必不可少的:Firefox或者Google
        }
    </script>
</head>
<body id="layoutbody" class="easyui-layout">
    <div data-options="region:'north',title:'North Title',split:true" style="height: 100px;">
    </div>
    <div data-options="region:'south',title:'South Title',split:true" style="height: 100px;">
    </div>
    <div data-options="region:'east',iconCls:'icon-reload',title:'East',split:true" style="width: 100px;">
    </div>
    <div data-options="region:'west',title:'West',split:true" style="width: 100px;">
        <input type="button" value="擷取panel" onclick="getPanel();" />
    </div>
    <div data-options="region:'center',title:'center title'" href="Index.htm" style="padding: 5px;
        background: #eee;">
        <input type="button" value="擷取panel" onclick="getPanel();" /><!--如果這裡指定了href屬性,那麼我們自己在這個部分寫的代碼將不會被現實-->
    </div>
</body>
</html>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.