Yahoo! UI Library

Accordion  1.0

Yahoo! UI Library > Accordion > AccordionPanel
Search:
 
Filters

Class AccordionPanel - extends Widget - uses WidgetChild, WidgetStdMod, MakeNode

The AccordionPanel class represents one of the panels within an accordion

Constructor

AccordionPanel ( cfg )
Parameters:
cfg <object> (optional) configuration attributes

Properties

_ATTRS_2_UI - protected static object

Defines the attributes that MakeNode should link to _uiSetXxxx methods to reflect them in the UI.

_CLASS_NAMES - protected static object

Defines the class names used by MakeNode, later stored in this._classNames.

_EVENTS - protected static object

Defines the UI events to be attached through MakeNode, specifically, click on the headers

_HEADER_TEMPLATE - protected static object

Defines the template used by MakeNode to build the container for the header

_TEMPLATE - protected static object

Defines the template used by MakeNode to build the container for the body

CONTENT_TEMPLATE - protected object

With the accordion panel container filled with with WidgetStdMod divs it seems like too much to have a separate contentBox

Methods

_afterExpanded

private void _afterExpanded ( ev )
Listener for the after Expanded change event, toggles the panel
Parameters:
ev <EventFacade>

_onHeaderClick

private void _onHeaderClick ( ev )
Responds to clicks in the header of this panel to toggle it
Parameters:
ev <EventFacade> uses target to make sure it is the header of this accordion and not that of a nested one

_syncUIStdMod

protected void _syncUIStdMod ( )
This is an override of WidgetStdMod method to prevent it from re-rendering the three sections again and again and wiping out the resize handles

_uiSetCloseable

private void _uiSetCloseable ( value )
Sets the close icon visible or not depending on the attribute closeable
Parameters:
value <Boolean> new value for the closeeable attribute

_uiSetContent

private void _uiSetContent ( value )
Sets the content on this panel
Parameters:
value <String | Node> content to be shown

_uiSetLabel

private void _uiSetLabel ( value )
Sets the label on the header of this panel
Parameters:
value <String> text to be shown

_uiSetResizeable

private void _uiSetResizeable ( value )
Plugs/unplugs the resize-plugin (if available) in response to the resizeable attribute
Parameters:
value <Boolean> new value for the resizeable attribute

close

void close ( )
Convenience method to close this panel. Called when the close icon, if present, is clicked. It fires the panelClose event to signal the container for it to remove the panel from the accordion.

collapse

void collapse ( )
Collapses this panel

expand

void expand ( )
Expands this panel

renderUI

protected void renderUI ( )
Adds the resizer to the body of the three section StdMod and creates a container for the actual content within

toggle

void toggle ( )
Toggles this panel from expanded to collapsed

Events

closeableChange

closeableChange ( event )
Fires when the value for the configuration attribute 'closeable' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

contentChange

contentChange ( event )
Fires when the value for the configuration attribute 'content' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

expandedChange

expandedChange ( event )
Fires when the value for the configuration attribute 'expanded' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

labelChange

labelChange ( event )
Fires when the value for the configuration attribute 'label' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

panelClose

panelClose ( )
Fired by the panel to signal the accordion to remove this panel. Closure of the panel can be prevented by listening and halting this event.

resizeableChange

resizeableChange ( event )
Fires when the value for the configuration attribute 'resizeable' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event <Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

Configuration Attributes

closeable - Boolean

Allows panels to be closed via an icon in the header. It shows or hides the close icon. Panels can be closedvia programming at any time, regardless of this attribute.
Default Value: true

content - String or Node instance

Content to be shown in the body of this accordion panel

expanded - Boolean

State of this panel
Default Value: false (collapsed)

label - String

Text to be shown in the header of this accordion panel

resizeable - Boolean

Allows panels to be resized. Requires the optional resize-plugin module to be loaded.
Default Value: true


Copyright © 2011 Yahoo! Inc. All rights reserved.