Yahoo! UI Library

layout  2.5.1

Yahoo! UI Library > layout > YAHOO.widget.Layout

Show Private Show Protected

Class YAHOO.widget.Layout - extends YAHOO.util.Element

Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.

Constructor

YAHOO.widget.Layout ( el , attrs )
Parameters:
el <String/HTMLElement> The element to make contain a layout.
attrs <Object> Object liternal containing configuration parameters.

Properties

browser - Object

A modified version of the YAHOO.env.ua object

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

addUnit

YAHOO.widget.LayoutUnit addUnit ( cfg )
Add a unit to this layout and if the layout is rendered, resize the layout.
Parameters:
cfg <Object> The config for the LayoutUnit that you want to add
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

getLayoutById

static Object getLayoutById ( )
Get's a layout object by the HTML id of the element associated with the Layout object.
Returns: Object
The Layout Object

getSizes

Object getSizes ( )
Get a reference to the internal Layout Unit sizes object used to build the layout wireframe
Returns: Object
An object of the layout unit sizes

getUnitById

YAHOO.widget.LayoutUnit getUnitById ( id )
Get the LayoutUnit by it's HTML id
Parameters:
id <String> The HTML element id of the unit
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

getUnitByPosition

YAHOO.widget.LayoutUnit getUnitByPosition ( pos )
Get the LayoutUnit by it's position in this layout
Parameters:
pos <String> The position of the unit in this layout
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

removeUnit

void removeUnit ( unit )
Remove the unit from this layout and resize the layout.
Parameters:
unit <Object> The LayoutUnit that you want to remove
Returns: void

render

YAHOO.widget.Layout render ( )
This method starts the render process, applying classnames and creating elements
Returns: YAHOO.widget.Layout
The Layout instance

resize

YAHOO.widget.Layout resize ( set )
Starts the chain of resize routines that will resize all the units.
Parameters:
set <Boolean> If set to false, it will NOT set the size, just perform the calculations (used for collapsing units)
Returns: YAHOO.widget.Layout
The Layout instance

toString

String toString ( )
Returns a string representing the Layout.
Returns: String

Events

beforeHeightChange

beforeHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'height' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinHeightChange

beforeMinHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'minHeight' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinWidthChange

beforeMinWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'minWidth' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeParentChange

beforeParentChange ( eventInfo )
Fires before the value for the configuration attribute 'parent' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeResize

beforeResize ( )
Firef at the beginning of the resize method. If you return false, the resize is cancelled.

beforeUnitsChange

beforeUnitsChange ( eventInfo )
Fires before the value for the configuration attribute 'units' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeWidthChange

beforeWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'width' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

heightChange

heightChange ( eventInfo )
Fires when the value for the configuration attribute 'height' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minHeightChange

minHeightChange ( eventInfo )
Fires when the value for the configuration attribute 'minHeight' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minWidthChange

minWidthChange ( eventInfo )
Fires when the value for the configuration attribute 'minWidth' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

parentChange

parentChange ( eventInfo )
Fires when the value for the configuration attribute 'parent' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

render

render ( )
Fired after the render method completes.

resize

resize ( )
Fired when this.resize is called

startResize

startResize ( )
Fired when the Resize Utility for a Unit fires it's startResize Event.

unitsChange

unitsChange ( eventInfo )
Fires when the value for the configuration attribute 'units' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

widthChange

widthChange ( eventInfo )
Fires when the value for the configuration attribute 'width' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

Configuration Attributes

height - Number

The height in pixels

minHeight - Number

The minimum height in pixels

minWidth - Number

The minimum width in pixels

parent - Object YAHOO.widget.Layout

If this layout is to be used as a child of another Layout instance, this config will bind the resize events together.

units - Array

An array of config definitions for the LayoutUnits to add to this layout

width - Number

The width in pixels

Configuration attributes inherited from YAHOO.util.Element:


Copyright © 2007 Yahoo! Inc. All rights reserved.