Yahoo! UI Library

accordion  1.04

Yahoo! UI Library > accordion > AccordionItem
Search:
 
Filters

Class AccordionItem - extends Widget

Create an AccordionItem widget.

Constructor

AccordionItem ( config )
Parameters:
config <Object> Object literal specifying AccordionItem configuration properties.

Properties

Accordion.ATTRS - static Object

Static property used to define the default attribute configuration for the Accordion.

AccordionItem.HTML_PARSER - protected static Object

Static Object hash used to capture existing markup for progressive enhancement. Keys correspond to config attribute names and values are selectors used to inspect the contentBox for an existing node structure.

AccordionItem.NAME - static String

Static property provides a string to identify the class.

WidgetStdMod.TEMPLATES - Object

The template HTML strings for each of header components. e.g.
{
icon : '<a class="yui-accordion-item-icon"></a>',
label: '<a href="#" class="yui-accordion-item-label"></a>',
iconsContainer: '<div class="yui-accordion-item-icons"></div>',
iconAlwaysVisible: '<a href="#" class="yui-accordion-item-iconalwaysvisible"></a>',
iconExpanded: '<a href="#" class="yui-accordion-item-iconexpanded"></a>',
iconClose: '<a href="#" class="yui-accordion-item-iconclose yui-accordion-item-iconclose-hidden"></a>'
}

Methods

_addHeaderComponents

protected void _addHeaderComponents ( )
Add label and icons in the header. Also, it creates header in if not set from markup

_closableChanged

protected void _closableChanged ( params )
Handles the change of "closableChanged" property. Hides or shows close icon
Parameters:
params <EventFacade> The event facade for the attribute change

_createHeader

protected void _createHeader ( )
Creates the header content

_labelChanged

protected void _labelChanged ( params )
Handles the change of "labelChanged" property. Updates item's UI with the label provided
Parameters:
params <EventFacade> The event facade for the attribute change

_onLinkClick

protected void _onLinkClick ( e )
Prevent default action on clicking the link in the label
Parameters:
e <Event> The click event

bindUI

protected void bindUI ( )
Configures/Sets up listeners to bind Widget State to UI/DOM

destructor

protected void destructor ( )
Destructor lifecycle implementation for the AccordionItem class.

initializer

protected void initializer ( config )
Initializer lifecycle implementation for the AccordionItem class.
Parameters:
config <Object> Configuration object literal for the AccordionItem

markAsAlwaysVisible

markAsAlwaysVisible ( alwaysVisible )
Marks the item as always visible by adding class to always visible icon. The icon will be updated only if needed.
Parameters:
alwaysVisible <Boolean> Whether or not the item should be marked as always visible
Returns:
Boolean Return true if the icon has been updated, false if there was no need to update

markAsCollapsing

markAsCollapsing ( collapsing )
Marks the item as collapsing by adding class to expand icon. The method will update icon only if needed.
Parameters:
collapsing <Boolean> Whether or not the item should be marked as collapsing
Returns:
Boolean Return true if the icon has been updated, false if there was no need to update

markAsExpanded

markAsExpanded ( expanded )
Marks the item as expanded by adding class to expand icon. The icon will be updated only if needed.
Parameters:
expanded <Boolean> Whether or not the item should be marked as expanded
Returns:
Boolean Return true if the icon has been updated, false if there was no need to update

markAsExpanding

markAsExpanding ( expanding )
Marks the item as expanding by adding class to expand icon. The method will update icon only if needed.
Parameters:
expanding <Boolean> Whether or not the item should be marked as expanding
Returns:
Boolean Return true if the icon has been updated, false if there was no need to update

renderUI

protected void renderUI ( )
Creates AccordionItem's header.

Events

alwaysVisibleChange

alwaysVisibleChange ( event )
Fires when the value for the configuration attribute 'alwaysVisible' 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

animationChange

animationChange ( event )
Fires when the value for the configuration attribute 'animation' 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

closableChange

closableChange ( event )
Fires when the value for the configuration attribute 'closable' 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

contentHeightChange

contentHeightChange ( event )
Fires when the value for the configuration attribute 'contentHeight' 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

iconAlwaysVisibleChange

iconAlwaysVisibleChange ( event )
Fires when the value for the configuration attribute 'iconAlwaysVisible' 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

iconChange

iconChange ( event )
Fires when the value for the configuration attribute 'icon' 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

iconCloseChange

iconCloseChange ( event )
Fires when the value for the configuration attribute 'iconClose' 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

iconExpandedChange

iconExpandedChange ( event )
Fires when the value for the configuration attribute 'iconExpanded' 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

iconsContainerChange

iconsContainerChange ( event )
Fires when the value for the configuration attribute 'iconsContainer' 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

nodeLabelChange

nodeLabelChange ( event )
Fires when the value for the configuration attribute 'nodeLabel' 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

stringsChange

stringsChange ( event )
Fires when the value for the configuration attribute 'strings' 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

alwaysVisible - Boolean

Get/Set the expanded status of the item
Default Value: false

animation - Object

Get/Set the animaton specific settings. By default there are no any settings. If set, they will overwrite Accordion's animation settings
Default Value: {}

closable - Boolean

Flag, indicated whether the item can be closed by user, or not If yes, there will be placed close icon, otherwise not
Default Value: false

contentHeight - Object

Describe the method, which will be used when expanding/collapsing the item. The value should be an object with at least one property ("method"):
method
The method can be one of these: "auto", "fixed" and "stretch"
height
Must be set only if method's value is "fixed"
Default Value: auto

expanded - Boolean

Get/Set the expanded status of the item
Default Value: false

icon - Node

Item's icon
Default Value: null

iconAlwaysVisible - Node

Icon always visible
Default Value: null

iconClose - Node

Icon close, or null if the item is not closable
Default Value: null

iconExpanded - Node

Icon expanded
Default Value: null

iconsContainer - Node

The container of iconAlwaysVisible, iconExpanded and iconClose
Default Value: null

label - String

The label of the item
Default Value: " "

nodeLabel - Node

The node, contains label
Default Value: null

strings - Object

Provides client side string localization support.
Default Value: Object English messages


Copyright © 2009 Yahoo! Inc. All rights reserved.