Accordion

(esrith/amos/container/Accordion)

This container widget holds a set of panes where every pane's title is visible but only one pane's content is visible at a time. By clicking on another pane title, that particular pane's content become visible while the previously shown pane is closed.

Description
new Accordion(params?srcNodeRef?)

Create a new Accordion widget.

Type Description
_styleAttr Object when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value
childs ContentPane[] Contentpane for each pane in order from top to bottom.
tabs Object[] Title of each pane in order from top to bottom.
Return type Description
__baseClassInherit(constructor) None get className from superclass.
addChild(contentPane) ContentPane Add a specified child.
disableChild(index) None Disable a specified child.
enableChild(index) None Enable a specified child.
hide(elem?) None Hide a specified element. The hidden element will not be displayed at all.
isVisible(elem?) Boolean Return true if the element is visible, otherwise false.
removeChild(index) None Remove a specified child.
selectChild(index) Boolean Select a specified child.
show(elem?) None Display a specified element.
toggle(elem?) None Toggle visibility of a specified element.
Description
change Fires when switching between panes.
click Fires on mouse click on an pane title.
Constructors Detail
new Accordion(params?srcNodeRef?)

Create a new Accordion widget.

Parameters:
Properties Detail
<Object>
_styleAttr
when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

Default value: {}

<ContentPane[]>
childs
Contentpane for each pane in order from top to bottom.
<Object[]>
tabs
Title of each pane in order from top to bottom.
Methods Detail
__baseClassInherit
(
  • constructor
)
get className from superclass.
Parameters
  • <Object> constructor Required
<ContentPane>
addChild
(
  • contentPane
)
Add a specified child.
Parameters
  • <ContentPane> contentPane Required
    Contentpane object to be input as a child node.
disableChild
(
  • index
)
Disable a specified child.
Parameters
  • <Number> index Required
    Index of the child.
enableChild
(
  • index
)
Enable a specified child.
Parameters
  • <Number> index Required
    Index of the child.
hide
(
  • elem?
)
Hide a specified element. The hidden element will not be displayed at all.
Parameters
  • <Node> elem Optional
    Specified element to be hidden.
<Boolean>
isVisible
(
  • elem?
)
Return true if the element is visible, otherwise false.
Parameters
  • <Node> elem Optional
    Specified element to be checked. If not specified, domNode of the widget is used instead.
removeChild
(
  • index
)
Remove a specified child.
Parameters
  • <Number> index Required
    Index of the child.
<Boolean>
selectChild
(
  • index
)
Select a specified child.
Parameters
  • <Number> index Required
    Index of the child.
show
(
  • elem?
)
Display a specified element.
Parameters
  • <Node> elem Optional
    Specified element to be displayed.
toggle
(
  • elem?
)
Toggle visibility of a specified element.
Parameters
  • <Node> elem Optional
    Specified element to toggle visibility.
Events Detail
change
Fires when switching between panes.
Event Payload:
  • <Object> Number
    index Index of the pane that is changed to.
click
Fires on mouse click on an pane title.
Event Payload:
  • <Object> Number
    index Index of the clicked pane.