Class AccordionItem
- extends Widget
Create an AccordionItem widget.
Constructor
AccordionItem
(
config
)
- Parameters:
-
config
<Object>
Object literal specifying AccordionItem configuration properties.
Properties
Static property used to define the default attribute
configuration for the Accordion.
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.
Static property provides a string to identify the class.
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
protected
void
_addHeaderComponents
(
)
Add label and icons in the header. Also, it creates header in if not set from markup
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
protected
void
_createHeader
(
)
Creates the header content
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
protected
void
_onLinkClick
(
e
)
Prevent default action on clicking the link in the label
- Parameters:
-
e
<Event>
The click event
protected
void
bindUI
(
)
Configures/Sets up listeners to bind Widget State to UI/DOM
protected
void
destructor
(
)
Destructor lifecycle implementation for the AccordionItem class.
protected
void
initializer
(
config
)
Initializer lifecycle implementation for the AccordionItem class.
- Parameters:
-
config
<Object>
Configuration object literal for the AccordionItem
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
(
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
(
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
(
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
protected
void
renderUI
(
)
Creates AccordionItem's header.
Events
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
Get/Set the expanded status of the item
Default Value: false
Get/Set the animaton specific settings. By default there are no any settings.
If set, they will overwrite Accordion's animation settings
Default Value: {}
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
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
Get/Set the expanded status of the item
Default Value: false
Icon close, or null if the item is not closable
Default Value: null
The container of iconAlwaysVisible, iconExpanded and iconClose
Default Value: null
Provides client side string localization support.
Default Value: Object English messages