Class RapidContext.Widget.Button

Extends: RapidContext.Widget

The button widget class. Used to provide a simple push button, using the <button> HTML element.

Source code: RapidContext_Widget_Button.js

Class Summary
 
Creates a new button widget.
Method Summary
 
setAttrs(attrs)
Updates the widget or HTML DOM node attributes.
Methods borrowed from class RapidContext.Widget:
addAll, addChildNode, addClass, animate, blurAll, destroy, disable, enable, getChildNodes, hasClass, hide, isDisabled, isHidden, removeAll, removeChildNode, removeClass, setStyle, show, toggleClass, uid
Event Summary
 
Emitted when the button has been clicked.
Class Detail
RapidContext.Widget.Button(attrs)
Creates a new button widget.
JavaScript:
var closeBtn = RapidContext.Widget.Button({ icon: "OK", highlight: true }, "Close");
User Interface XML:
<Button id="closeBtn" icon="OK" highlight="true">Close</Button>
Parameters:
{Object} attrs
the widget and node attributes
{Boolean} attrs.disabled Optional
the disabled widget flag, defaults to false
{Boolean} attrs.hidden Optional
the hidden widget flag, defaults to false
{Boolean} attrs.highlight Optional
the highlight option flag, defaults to false
{String} attrs.icon Optional
the icon reference to use, defaults to null (no icon)
{Object} ... Optional
the child widgets or DOM nodes
Returns:
{Widget} the widget DOM node
Method Detail
setAttrs(attrs)
Updates the widget or HTML DOM node attributes.
Parameters:
{Object} attrs
the widget and node attributes to set
{Boolean} attrs.disabled Optional
the disabled widget flag
{Boolean} attrs.hidden Optional
the hidden widget flag
{Boolean} attrs.highlight Optional
the highlight option flag
{Icon/Object/String} attrs.icon Optional
the icon reference to use
Event Detail
onclick()
Emitted when the button has been clicked. This is a standard DOM event.