Yahoo! UI Library

layout  2.5.1

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

Show Private Show Protected

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

Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.

Constructor

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

Properties

body - HTMLElement

A reference to the HTML element used for the body

browser - Object

A modified version of the YAHOO.env.ua object

footer - HTMLElement

A reference to the HTML element used for the footer

header - HTMLELement

A reference to the HTML element used for the Header

STR_CLOSE - {String}

String used for close button title

STR_COLLAPSE - {String}

String used for collapse button title

STR_EXPAND - {String}

String used for expand button title

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

close

YAHOO.widget.Layout close ( )
Close the unit, removing it from the parent Layout.
Returns: YAHOO.widget.Layout
The parent Layout instance

collapse

YAHOO.widget.LayoutUnit collapse ( )
Collapse the Unit if it is not collapsed.
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

destroy

YAHOO.widget.Layout destroy ( )
Removes this unit from the parent and cleans up after itself.
Returns: YAHOO.widget.Layout
The parent Layout instance

expand

YAHOO.widget.LayoutUnit expand ( )
Expand the Unit if it is collapsed.
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

getLayoutUnitById

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

getSizes

Object getSizes ( )
Get a reference to the internal sizes object for this unit
Returns: Object
An object of the sizes used for calculations

resize

YAHOO.widget.LayoutUnit resize ( force )
Resize either the unit or it's clipped state, also updating the box inside
Parameters:
force <Boolean> This will force full calculations even when the unit is collapsed
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

toggle

YAHOO.widget.LayoutUnit toggle ( )
Toggles the Unit, replacing it with a clipped version.
Returns: YAHOO.widget.LayoutUnit
The LayoutUnit instance

toString

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

Events

animateChange

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

beforeAnimateChange

beforeAnimateChange ( eventInfo )
Fires before the value for the configuration attribute 'animate' 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.

beforeBodyChange

beforeBodyChange ( eventInfo )
Fires before the value for the configuration attribute 'body' 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.

beforeCloseChange

beforeCloseChange ( eventInfo )
Fires before the value for the configuration attribute 'close' 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.

beforeCollapse

beforeCollapse ( )
Fired before the unit is collapsed. If you return false, the collapse is cancelled.

beforeCollapseChange

beforeCollapseChange ( eventInfo )
Fires before the value for the configuration attribute 'collapse' 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.

beforeCollapseSizeChange

beforeCollapseSizeChange ( eventInfo )
Fires before the value for the configuration attribute 'collapseSize' 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.

beforeDurationChange

beforeDurationChange ( eventInfo )
Fires before the value for the configuration attribute 'duration' 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.

beforeEasingChange

beforeEasingChange ( eventInfo )
Fires before the value for the configuration attribute 'easing' 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.

beforeExpand

beforeExpand ( )
Fired before the unit is exanded. If you return false, the collapse is cancelled.

beforeFooterChange

beforeFooterChange ( eventInfo )
Fires before the value for the configuration attribute 'footer' 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.

beforeGridsChange

beforeGridsChange ( eventInfo )
Fires before the value for the configuration attribute 'grids' 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.

beforeGutterChange

beforeGutterChange ( eventInfo )
Fires before the value for the configuration attribute 'gutter' 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.

beforeHeaderChange

beforeHeaderChange ( eventInfo )
Fires before the value for the configuration attribute 'header' 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.

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.

beforeHoverChange

beforeHoverChange ( eventInfo )
Fires before the value for the configuration attribute 'hover' 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.

beforeLeftChange

beforeLeftChange ( eventInfo )
Fires before the value for the configuration attribute 'left' 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.

beforeMaxHeightChange

beforeMaxHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'maxHeight' 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.

beforeMaxWidthChange

beforeMaxWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'maxWidth' 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.

beforePositionChange

beforePositionChange ( eventInfo )
Fires before the value for the configuration attribute 'position' 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.

beforeProxyChange

beforeProxyChange ( eventInfo )
Fires before the value for the configuration attribute 'proxy' 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.

beforeResizeChange

beforeResizeChange ( eventInfo )
Fires before the value for the configuration attribute 'resize' 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.

beforeScrollChange

beforeScrollChange ( eventInfo )
Fires before the value for the configuration attribute 'scroll' 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.

beforeTopChange

beforeTopChange ( eventInfo )
Fires before the value for the configuration attribute 'top' 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.

beforeWrapChange

beforeWrapChange ( eventInfo )
Fires before the value for the configuration attribute 'wrap' 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.

bodyChange

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

close

close ( )
Fired when the unit is closed

closeChange

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

collapse

collapse ( )
Fired when the unit is collapsed

collapseChange

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

collapseSizeChange

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

contentChange

contentChange ( )
Fired when the content in the header, body or footer is changed via the API

durationChange

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

easingChange

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

expand

expand ( )
Fired when the unit is exanded

footerChange

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

gridsChange

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

gutterChange

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

headerChange

headerChange ( eventInfo )
Fires when the value for the configuration attribute 'header' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous 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.

hoverChange

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

leftChange

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

maxHeightChange

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

maxWidthChange

maxWidthChange ( eventInfo )
Fires when the value for the configuration attribute 'maxWidth' 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.

positionChange

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

proxyChange

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

resize

resize ( )
Fired when this.resize is called

resizeChange

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

scrollChange

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

startResize

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

topChange

topChange ( eventInfo )
Fires when the value for the configuration attribute 'top' 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.

wrapChange

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

Configuration Attributes

animate - Boolean

Use animation to collapse/expand the unit

body - object

The content for the body. If we find an element in the page with an id that matches the passed option we will move that element into the body of this unit.

close - object

Adds a close icon to the unit

collapse - object

Adds a collapse icon to the unit

collapseSize - Number

The pixel size of the Clip that we will collapse to

duration - object

The duration to give the Animation Utility when animating the opening and closing of Units

easing - object

The Animation Easing to apply to the Animation instance for this unit.

footer - object

The content for the footer. If we find an element in the page with an id that matches the passed option we will move that element into the footer of this unit.

grids - Boolean

Set this option to true if you want the LayoutUnit to fix the first layer of YUI CSS Grids (margins)

gutter - String

The gutter that we should apply to the parent Layout around this Unit. Supports standard CSS markup: (2 4 0 5) or (2) or (2 5)

header - object

The text to use as the Header of the Unit

height - Number

The height of the Unit

hover - object

Config option to pass to the Resize Utility

maxHeight - Number

The maxHeight parameter passed to the Resize Utility

maxWidth - Number

The maxWidth parameter passed to the Resize Utility

minHeight - Number

The minHeight parameter passed to the Resize Utility

minWidth - Number

The minWidth parameter passed to the Resize Utility

parent - {Object} YAHOO.widget.Layout

The parent Layout that we are assigned to

position - {String}

The position (top, right, bottom, left or center) of the Unit in the Layout

proxy - Boolean

Use the proxy config setting for the Resize Utility

resize - object

Should a Resize instance be added to this unit

scroll - object

Adds a class to the unit to allow for overflow: auto, default is overflow: hidden

top - private Number

The current top positioning of the Unit

width - Number

The width of the Unit

wrap - private HTMLElement

A reference to the wrap element

Configuration attributes inherited from YAHOO.util.Element:


Copyright © 2007 Yahoo! Inc. All rights reserved.