Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create nested center and south in jQuery UI Layout Plug-in?

How can I create nested inner centers and inner souths? The following doesn't seem to do anything other than display "Inner Center" and "Inner South"? How can I make it show the layout resizer for Inner Center and Inner South?

<html>
    <head>
        <title>TEST</title>
        <script src="jquery-latest.js"></script>
        <script src="jquery.layout-latest.js"></script>
        <script>
            $(document).ready(function () {
                $('body').layout({ applyDefaultStyles: true });
            });
        </script>
    </head>

    <body>
        <div class="ui-layout-center">
            Center
            <div class="ui-layout-center">Inner Center</div>
            <div class="ui-layout-south">Inner South</div>
        </div>
        <div class="ui-layout-north">North</div>
        <div class="ui-layout-west">West</div>
    </body>
</html>

http://layout.jquery-dev.net/demos/example.html

^Similar to this but with a "Inner Center" and "Inner South" in the "Center" area.

like image 554
rotaercz Avatar asked Feb 16 '23 21:02

rotaercz


1 Answers

If you want to have nested layouts you need to call layout for each container where you want the nesting. So you need to mark your current ui-layout-center where you have the nested container e.g. with an id:

<div class="ui-layout-center" id="inner">
    <div class="ui-layout-center">Inner Center</div>
    <div class="ui-layout-south">Inner South</div>
</div>
<div class="ui-layout-north">North</div>
<div class="ui-layout-west">West</div>

And call again the layout on #inner to create the nested layout:

$('body').layout({
     applyDefaultStyles: true
});
$('#inner').layout({
     applyDefaultStyles: true
});

Demo JSFiddle.

See also the offical complex demo

like image 107
nemesv Avatar answered Feb 18 '23 09:02

nemesv