Zimlet JavaScript API Reference - DwtAccordion

Class DwtAccordion


Extends DwtComposite.

This class implements an accordion widget, which is a stack of expandable accordion headers. Clicking on an accordion header's button expands it in place.

Defined in: DwtAccordion.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
DwtAccordion(parent, className, posStyle)
Creates an empty accordion widget.
Method Summary
Method Attributes Method Name and Description
 
Adds an item to the accordion, in the form of a table row.
 
Adds a listener to be notified when the button is pressed.
 
expandItem(id, notify)
Expands the accordion item with the given ID by making its body visible.
 
getBody(id)
Gets the element of the accordion item with the given ID.
 
Gets the expanded accordion item.
 
Gets the
element of the accordion item with the given ID.
 
getItem(id)
Gets the accordion item with the given ID.
 
Gets the item by index.
 
Gets the ordered list of accordion items.
 
Hides all accordion items.
 
resize(width, height)
Resizes the accordion.
 
setEnabled(enabled)
Allows the accordion items to be clickable or not.
 
setItemContent(id, contentObject)
Attaches the HTML content of the given control to the accordion item with the given ID.
 
show(show)
Shows or hides the accordion.
 
Shows single accordion item based on given id.
 
showAlert(id, show)
Shows or hides an alert (aka orange background) on the accordion header
 
Returns a string representation of the object.
Methods borrowed from class DwtComposite:
addChild, cleanupSeparators, clear, dispose, getChild, getChildren, getNumChildren, getTabGroupMember, removeChild, removeChildren
Methods borrowed from class DwtControl:
addClassName, addControlListener, addDisposeListener, addListener, appendElement, blur, clearContent, clearHandler, condClassName, delClassName, focus, getBounds, getClassName, getContent, getCursor, getData, getDragBox, getDragSource, getDropTarget, getEnabled, getFocusElement, getH, getHtmlElement, getHTMLElId, getInsetBounds, getInsets, getLocation, getMargins, getOpacity, getOuterSize, getPosition, getScrollContainer, getScrollStyle, getSize, getTooltipBase, getToolTipContent, getVisibility, getVisible, getW, getX, getXW, getY, getYH, getZIndex, hasFocus, isAlertShown, isDisposed, isInitialized, isListenerRegistered, notifyListeners, preventContextMenu, preventSelection, removeAllListeners, removeControlListener, removeDisposeListener, removeListener, reparent, reparentHtmlElement, replaceElement, setBounds, setClassName, setContent, setCursor, setData, setDisplay, setDisplayState, setDragBox, setDragSource, setDropTarget, setEventPropagation, setFocusElement, setHandler, setHtmlElementId, setLocation, setOpacity, setPosition, setScrollStyle, setSize, setToolTipContent, setVisibility, setVisible, setZIndex, zShow
Class Detail
DwtAccordion(parent, className, posStyle)
Creates an empty accordion widget.
Author: Parag Shah.
Parameters:
{DwtControl} parent
the parent widget
{string} className
the CSS class
{Dwt.STATIC_STYLE|Dwt.ABSOLUTE_STYLE|Dwt.RELATIVE_STYLE} posStyle
the positioning style
Method Detail
addAccordionItem(params)
Adds an item to the accordion, in the form of a table row.
Parameters:
{hash} params
a hash of parameters
{string} params.title
the text for accordion header
{hash} params.data
the item data
{string} params.icon
the icon
{boolean} params.hideHeader
if true, do not show header (ideal when there's only one visible header item)

addSelectionListener(listener)
Adds a listener to be notified when the button is pressed.
Parameters:
{AjxListener} listener
a listener

expandItem(id, notify)
Expands the accordion item with the given ID by making its body visible. The bodies of other items are hidden.
Parameters:
{number} id
the accordion item ID
{boolean} notify
if true, selection listeners are to be notified

{Element} getBody(id)
Gets the element of the accordion item with the given ID.
Parameters:
{number} id
the accordion item ID
Returns:
{Element} the element

{DwtAccordionItem} getExpandedItem()
Gets the expanded accordion item.
Returns:
{DwtAccordionItem} the item

{Element} getHeader(id)
Gets the
element of the accordion item with the given ID.
Parameters:
{number} id
the accordion item ID
Returns:
{Element} the element

{DwtAccordionItem} getItem(id)
Gets the accordion item with the given ID.
Parameters:
{number} id
the accordion item ID
Returns:
{DwtAccordionItem} the item or null if not found

{DwtAccordionItem} getItemByIndex(id)
Gets the item by index.
Parameters:
{number} id
the accordion item index
Returns:
{DwtAccordionItem} the item or null if not found

{array} getItems()
Gets the ordered list of accordion items.
Returns:
{array} an array of DwtAccordionItem objects

hideAccordionItems()
Hides all accordion items.

resize(width, height)
Resizes the accordion. This override applies accordion size changes to accordion items as well.
Parameters:
{number} width
the new width for accordion
{number} height
the new height for accordion

setEnabled(enabled)
Allows the accordion items to be clickable or not. If disabled, the label of each accordion item will be grayed out.
Parameters:
{boolean} enabled
if true, enabled.

setItemContent(id, contentObject)
Attaches the HTML content of the given control to the accordion item with the given ID.
Parameters:
{number} id
the accordion item ID
{DwtControl} contentObject
the control that contains this item's content

show(show)
Shows or hides the accordion.
Parameters:
{boolean} show
if true, show the accordion; otherwise hide it

showAccordionItem(id)
Shows single accordion item based on given id.
Parameters:
{number} id
the accordion item ID

showAlert(id, show)
Shows or hides an alert (aka orange background) on the accordion header
Parameters:
{number} id
the accordion item ID
{boolean} show
if true, show the alert

{string} toString()
Returns a string representation of the object.
Returns:
{string} a string representation of the object

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:26 GMT-0400 (EDT)