• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Layout (gallery-axo-layout)

    Last Updated: 01/4/11
    + 2 -

    Axosoft

    Created: 12/8/10
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.3.0 PR3
    Free for use.

    This layout module is based on 1xN and Nx1 layouts, which can be used alone or nested to combine more complex layouts such as the 5-unit layout from YUI2 Layout Manager. A layout can be tied to window size, and individual units can be resized, made collapsable, and/or given standard module format sections (header, content, footer) with an auto-generated header.

    Syntactic sugar specific to the 5-unit layout will be added in the future.

    The implementation is in its initial stages. Feedback on the implementation and suggestions for future development are welcome. The module design will probably need to evolve a bit before it settles into something good.

    Known issues / current limitations:

    • If the layout is sized to small (or its children too large), children will start to overlap each other
    • if the style for a layout's contentBox includes a margin, the layout will likely break (border and padding should be OK)

    • Tags:
    • axo-layout
    • layout
    • layout manager
    • axosoft
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Note that the layout currently doesn't provide a style skin - see the linked example for an example style.

    Code Sample

    YUI().use('gallery-axo-layout', 'resize', function(Y)
    {
    	// This creates a vertical layout whose size is tied to the window size
    	var layout = new Y.Layout({orientation: 'vertical', sizeToWindow: true });
     
    	// This adds a child (layout unit) to the layout.  Since it is a vertical layout,
    	// and this is the first child, it will show up on the top.  LayoutChild is
    	// a widget, so it supports configuration arguments such as id and height.
    	// The resize:true parameter will add resizing capability to the child.
    	layout.add(new Y.LayoutChild({id:'top', height:100, resize: true }));
     
    	// This creates another layout and adds it as a child to the root layout,
    	// resulting in a nested layout.  The fluid:true parameter means that the height
    	// of this child will be determined by available space.
    	var centerLayout = new Y.Layout({fluid: true, orientation: 'horizontal' });
    	layout.add(centerLayout);
     
    	// This is another child layout, but with an initial fixed height and resizable.
    	var bottomLayout = new Y.Layout({id:'bottom', height:100, orientation: 'horizontal', resize: true });
    	layout.add(bottomLayout);
     
    	// We now fill up the center child layout. Two of the children have initial
    	// fixed widths, and are collapsable and resizable.  The center child will be
    	// sized according to available space.
    	// We will also give the children standard module format sections and auto-generated headers,
    	// by using the *Std layout children
    	centerLayout.add(new Y.LayoutChildCollapsableStd({id: 'left', width:150, resize: true, label:'Left'}));
    	centerLayout.add(new Y.LayoutChildStd({id: 'center', fluid: true, label:'Center' }));
    	centerLayout.add(new Y.LayoutChildCollapsableStd({id: 'right', width:150, resize: true, label:'Right'}));
     
    	// The bottom layout will be divided into 4 parts.  The first part will have
    	// a fixed width of 100 pixels.  The remaining three are given a weight using
    	// the fluid argument.  They will fill up the remaining space, and their
    	// weights will result in 1:2:3 proportions in their size.
    	bottomLayout.add(new Y.LayoutChild({id: 'bottom1', width:100}));
    	bottomLayout.add(new Y.LayoutChild({id: 'bottom2', fluid:1}));
    	bottomLayout.add(new Y.LayoutChild({id: 'bottom3', fluid:2}));
    	bottomLayout.add(new Y.LayoutChild({id: 'bottom4', fluid:3}));
     
    	layout.render();
    });

    Forum Posts

    Subject Author Date
    automatic styling Sebastián Gurin 08/18/12
    Layout help Charles Heizer 01/25/13

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info