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
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
With the accordion panel container filled with with WidgetStdMod divs
it seems like too much to have a separate contentBox
Methods
private
void
_afterExpanded
(
ev
)
Listener for the after Expanded change event, toggles the panel
- Parameters:
-
ev
<EventFacade>
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
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
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
private
void
_uiSetContent
(
value
)
Sets the content on this panel
- Parameters:
-
value
<String | Node>
content to be shown
private
void
_uiSetLabel
(
value
)
Sets the label on the header of this panel
- Parameters:
-
value
<String>
text to be shown
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
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.
void
collapse
(
)
Collapses this panel
void
expand
(
)
Expands this panel
protected
void
renderUI
(
)
Adds the resizer to the body of the three section StdMod
and creates a container for the actual content within
void
toggle
(
)
Toggles this panel from expanded to collapsed
Events
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
(
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
(
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
(
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
(
)
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
(
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
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
Default Value: false (collapsed)
Text to be shown in the header of this accordion panel
Allows panels to be resized.
Requires the optional resize-plugin module to be loaded.
Default Value: true