Class RapidContext.Widget.Icon

.Widget.Icon(def) → {Widget}

The icon widget class. Used to provide a small clickable image, using the <i> HTML element. The icons can be either image- or font-based, causing slightly different behaviours with respect to size. A number of predefined icons suitable for different actions are available (using the Font-Awesome icon font).

Constructor Summary
Creates a new icon widget.
Field Summary
(static)
ADD
The add icon definition.
(static)
The application icon definition.
(static)
The application terminal icon definition.
(static)
The asterisk icon definition.
(static)
The attach file icon definition.
(static)
The automatic icon definition.
(static)
The bar chart icon definition.
(static)
The blank icon definition.
(static)
The book icon definition.
(static)
The open book icon definition.
(static)
The calculator icon definition.
(static)
The calendar icon definition.
(static)
The cancel icon definition.
(static)
The clock icon definition.
(static)
The close icon definition.
(static)
The close active icon definition.
(static)
The blue close icon definition.
(static)
The bluewhite close icon definition.
(static)
The close (inverse video) icon definition.
(static)
The color icon definition.
(static)
The comment icon definition.
(static)
The comments icon definition.
(static)
The component icon definition.
(static)
The components icon definition.
(static)
The configure icon definition.
(static)
The contact icon definition.
(static)
The copy icon definition.
(static)
CSS
The CSS icon definition.
(static)
The curve chart icon definition.
(static)
CUT
The cut icon definition.
(static)
The database icon definition.
(static)
The date icon definition.
(static)
The default icon definition, inherited by all others.
(static)
The delay icon definition.
(static)
The delete icon definition.
(static)
The dialog icon definition.
(static)
The disk icon definition.
(static)
The document icon definition.
(static)
The code document icon definition.
(static)
The Excel document icon definition.
(static)
The Office document icon definition.
(static)
The PDF document icon definition.
(static)
The document search icon definition.
(static)
The text document icon definition.
(static)
The Word document icon definition.
(static)
The down icon definition.
(static)
The network drive icon definition.
(static)
The edit icon definition.
(static)
The layout edit icon definition.
(static)
The white edit icon definition.
(static)
The email icon definition.
(static)
The error icon definition.
(static)
The expand icon definition.
(static)
The export icon definition.
(static)
The web feed icon definition.
(static)
The first icon definition.
(static)
The flag icon definition.
(static)
The blue flag icon definition.
(static)
The green flag icon definition.
(static)
The red flag icon definition.
(static)
The yellow flag icon definition.
(static)
The folder icon definition.
(static)
The add folder icon definition.
(static)
The font icon definition.
(static)
The group icon definition.
(static)
The help icon definition.
(static)
The home icon definition.
(static)
The HTML icon definition.
(static)
The HTML source icon definition.
(static)
The image icon definition.
(static)
The information icon definition.
(static)
KEY
The key icon definition.
(static)
The keyboard icon definition.
(static)
The last icon definition.
(static)
The layout icon definition.
(static)
The left icon definition.
(static)
The like icon definition.
(static)
The line chart icon definition.
(static)
The loading icon definition.
(static)
The lock icon definition.
(static)
The minus icon definition.
(static)
The monitor icon definition.
(static)
The next icon definition.
(static)
NO
The no icon definition.
(static)
The note icon definition.
(static)
OK
The ok icon definition.
(static)
The options icon definition.
(static)
The organization chart icon definition.
(static)
The package icon definition.
(static)
The phone icon definition.
(static)
The mobile phone icon definition.
(static)
The pie chart icon definition.
(static)
The plug-in icon definition.
(static)
The add plug-in icon definition.
(static)
The plug-in error icon definition.
(static)
The inactive plug-in icon definition.
(static)
The remove plug-in icon definition.
(static)
The plus icon definition.
(static)
The previous icon definition.
(static)
The printer icon definition.
(static)
The reload icon definition.
(static)
The remove icon definition.
(static)
The resize icon definition.
(static)
The right icon definition.
(static)
RSS
The RSS icon definition.
(static)
The script icon definition.
(static)
The search icon definition.
(static)
The select icon definition.
(static)
The server icon definition.
(static)
The stop icon definition.
(static)
The style icon definition.
(static)
SUM
The sum icon definition.
(static)
The table icon definition.
(static)
TAG
The tag icon definition.
(static)
The blue tag icon definition.
(static)
The green tag icon definition.
(static)
The red tag icon definition.
(static)
The yellow tag icon definition.
(static)
The textfield icon definition.
(static)
The text format icon definition.
(static)
UP
The up icon definition.
(static)
The user icon definition.
(static)
The vector icon definition.
(static)
The warning icon definition.
(static)
The XHTML icon definition.
(static)
YES
The yes icon definition.
Method Summary
Adds one or more children to this widget.
Adds a single child DOM node to this widget.
Adds the specified CSS class names to this HTML DOM node.
Performs a visual effect animation on this widget.
Blurs (unfocuses) this DOM node and all relevant child nodes.
The internal widget destructor function.
Disables this widget if it was previously enabled.
Dispatches a single event from this DOM node.
Enables this widget if it was previously disabled.
Returns an array with all child DOM nodes.
Checks if this HTML DOM node has the specified CSS class names.
Hides this widget node if it was previously visible.
Checks if this widget is disabled.
Checks if this widget node is hidden.
Removes one or more previously attached event listeners.
Attaches a listener function for one or more events.
Attaches a single event listener function.
Removes all children to this widget.
Removes a single child DOM node from this widget.
Removes the specified CSS class names from this HTML DOM node.
Updates the icon or HTML DOM node attributes.
Updates the CSS styles of this HTML DOM node.
Shows this widget node if it was previously hidden.
Toggles adding and removing the specified CSS class names to and from this HTML DOM node.
Returns the unique identifier for this DOM node.

Constructor

new Icon(def) → {Widget}

Creates a new icon widget.

Parameters:
Name Type Description
def {string|Object|Node} the icon ref, class, attributes or DOM node
Properties
Name Type Attributes Description
ref {string} <optional>
the predefined icon name (reference)
class {string} <optional>
the icon CSS class names
url {string} <optional>
the icon image URL
position {string} <optional>
the icon image position
width {number} <optional>
the icon width (in pixels)
height {number} <optional>
the icon height (in pixels)
tooltip {string} <optional>
the icon tooltip text
disabled {boolean} <optional>
the disabled widget flag, defaults to false
hidden {boolean} <optional>
the hidden widget flag, defaults to false
Returns:
{Widget} the widget DOM node
Examples:

JavaScript

var style = { "margin-left": "3px" };
var dataReload = RapidContext.Widget.Icon({ ref: "RELOAD", style: style });
var dataLoading = RapidContext.Widget.Icon({ ref: "LOADING", hidden: true, style: style });
var h3 = MochiKit.DOM.H3({}, "Data List:", dataReload, dataLoading);

User Interface XML

<h3>
  Data List:
  <Icon id="dataReload" ref="RELOAD" style="margin-left: 3px;" />
  <Icon id="dataLoading" ref="LOADING" hidden="true" style="margin-left: 3px;" />
</h3>
Source:
RapidContext_Widget_Icon.js, line 59

Extends

Members

(static) ADD

The add icon definition.

Source:
RapidContext_Widget_Icon.js, line 263

(static) APPLICATION

The application icon definition.

Source:
RapidContext_Widget_Icon.js, line 653

(static) APPLICATION_TERMINAL

The application terminal icon definition.

Source:
RapidContext_Widget_Icon.js, line 658

(static) ASTERISK

The asterisk icon definition.

Source:
RapidContext_Widget_Icon.js, line 313

(static) ATTACH

The attach file icon definition.

Source:
RapidContext_Widget_Icon.js, line 388

(static) AUTOMATIC

The automatic icon definition.

Source:
RapidContext_Widget_Icon.js, line 393

(static) BARCHART

The bar chart icon definition.

Source:
RapidContext_Widget_Icon.js, line 423

(static) BLANK

The blank icon definition.

Source:
RapidContext_Widget_Icon.js, line 143

(static) BOOK

The book icon definition.

Source:
RapidContext_Widget_Icon.js, line 748

(static) BOOK_OPEN

The open book icon definition.

Source:
RapidContext_Widget_Icon.js, line 753

(static) CALCULATOR

The calculator icon definition.

Source:
RapidContext_Widget_Icon.js, line 738

(static) CALENDAR

The calendar icon definition.

Source:
RapidContext_Widget_Icon.js, line 488

(static) CANCEL

The cancel icon definition.

Source:
RapidContext_Widget_Icon.js, line 203

(static) CLOCK

The clock icon definition.

Source:
RapidContext_Widget_Icon.js, line 758

(static) CLOSE

The close icon definition.

Source:
RapidContext_Widget_Icon.js, line 153

(static) CLOSE_ACTIVE

The close active icon definition.

Source:
RapidContext_Widget_Icon.js, line 163

(static) CLOSE_BLUE

The blue close icon definition.

Source:
RapidContext_Widget_Icon.js, line 173

(static) CLOSE_BLUEWHITE

The bluewhite close icon definition.

Source:
RapidContext_Widget_Icon.js, line 168

(static) CLOSE_INVERSE

The close (inverse video) icon definition.

Source:
RapidContext_Widget_Icon.js, line 158

(static) COLOR

The color icon definition.

Source:
RapidContext_Widget_Icon.js, line 518

(static) COMMENT

The comment icon definition.

Source:
RapidContext_Widget_Icon.js, line 638

(static) COMMENTS

The comments icon definition.

Source:
RapidContext_Widget_Icon.js, line 643

(static) COMPONENT

The component icon definition.

Source:
RapidContext_Widget_Icon.js, line 673

(static) COMPONENTS

The components icon definition.

Source:
RapidContext_Widget_Icon.js, line 678

(static) CONFIG

The configure icon definition.

Source:
RapidContext_Widget_Icon.js, line 383

(static) CONTACT

The contact icon definition.

Source:
RapidContext_Widget_Icon.js, line 623

(static) COPY

The copy icon definition.

Source:
RapidContext_Widget_Icon.js, line 268

(static) CSS

The CSS icon definition.

Source:
RapidContext_Widget_Icon.js, line 458

(static) CURVECHART

The curve chart icon definition.

Source:
RapidContext_Widget_Icon.js, line 433

(static) CUT

The cut icon definition.

Source:
RapidContext_Widget_Icon.js, line 273

(static) DATABASE

The database icon definition.

Source:
RapidContext_Widget_Icon.js, line 723

(static) DATE

The date icon definition.

Source:
RapidContext_Widget_Icon.js, line 493

(static) DEFAULT

The default icon definition, inherited by all others.

Source:
RapidContext_Widget_Icon.js, line 138

(static) DELAY

The delay icon definition.

Source:
RapidContext_Widget_Icon.js, line 763

(static) DELETE

The delete icon definition.

Source:
RapidContext_Widget_Icon.js, line 278

(static) DIALOG

The dialog icon definition.

Source:
RapidContext_Widget_Icon.js, line 663

(static) DISK

The disk icon definition.

Source:
RapidContext_Widget_Icon.js, line 718

(static) DOCUMENT

The document icon definition.

Source:
RapidContext_Widget_Icon.js, line 583

(static) DOCUMENT_CODE

The code document icon definition.

Source:
RapidContext_Widget_Icon.js, line 613

(static) DOCUMENT_EXCEL

The Excel document icon definition.

Source:
RapidContext_Widget_Icon.js, line 593

(static) DOCUMENT_OFFICE

The Office document icon definition.

Source:
RapidContext_Widget_Icon.js, line 598

(static) DOCUMENT_PDF

The PDF document icon definition.

Source:
RapidContext_Widget_Icon.js, line 603

The document search icon definition.

Source:
RapidContext_Widget_Icon.js, line 608

(static) DOCUMENT_TEXT

The text document icon definition.

Source:
RapidContext_Widget_Icon.js, line 618

(static) DOCUMENT_WORD

The Word document icon definition.

Source:
RapidContext_Widget_Icon.js, line 588

(static) DOWN

The down icon definition.

Source:
RapidContext_Widget_Icon.js, line 213

(static) DRIVE_NETWORK

The network drive icon definition.

Source:
RapidContext_Widget_Icon.js, line 693

(static) EDIT

The edit icon definition.

Source:
RapidContext_Widget_Icon.js, line 288

(static) EDIT_LAYOUT

The layout edit icon definition.

Source:
RapidContext_Widget_Icon.js, line 298

(static) EDIT_WHITE

The white edit icon definition.

Source:
RapidContext_Widget_Icon.js, line 293

(static) EMAIL

The email icon definition.

Source:
RapidContext_Widget_Icon.js, line 728

(static) ERROR

The error icon definition.

Source:
RapidContext_Widget_Icon.js, line 418

(static) EXPAND

The expand icon definition.

Source:
RapidContext_Widget_Icon.js, line 308

(static) EXPORT

The export icon definition.

Source:
RapidContext_Widget_Icon.js, line 398

(static) FEED

The web feed icon definition.

Source:
RapidContext_Widget_Icon.js, line 448

(static) FIRST

The first icon definition.

Source:
RapidContext_Widget_Icon.js, line 228

(static) FLAG

The flag icon definition.

Source:
RapidContext_Widget_Icon.js, line 328

(static) FLAG_BLUE

The blue flag icon definition.

Source:
RapidContext_Widget_Icon.js, line 338

(static) FLAG_GREEN

The green flag icon definition.

Source:
RapidContext_Widget_Icon.js, line 343

(static) FLAG_RED

The red flag icon definition.

Source:
RapidContext_Widget_Icon.js, line 333

(static) FLAG_YELLOW

The yellow flag icon definition.

Source:
RapidContext_Widget_Icon.js, line 348

(static) FOLDER

The folder icon definition.

Source:
RapidContext_Widget_Icon.js, line 563

(static) FOLDER_ADD

The add folder icon definition.

Source:
RapidContext_Widget_Icon.js, line 568

(static) FONT

The font icon definition.

Source:
RapidContext_Widget_Icon.js, line 473

(static) GROUP

The group icon definition.

Source:
RapidContext_Widget_Icon.js, line 558

(static) HELP

The help icon definition.

Source:
RapidContext_Widget_Icon.js, line 408

(static) HOME

The home icon definition.

Source:
RapidContext_Widget_Icon.js, line 743

(static) HTML

The HTML icon definition.

Source:
RapidContext_Widget_Icon.js, line 463

(static) HTML_SOURCE

The HTML source icon definition.

Source:
RapidContext_Widget_Icon.js, line 523

(static) IMAGE

The image icon definition.

Source:
RapidContext_Widget_Icon.js, line 733

(static) INFO

The information icon definition.

Source:
RapidContext_Widget_Icon.js, line 403

(static) KEY

The key icon definition.

Source:
RapidContext_Widget_Icon.js, line 578

(static) KEYBOARD

The keyboard icon definition.

Source:
RapidContext_Widget_Icon.js, line 703

(static) LAST

The last icon definition.

Source:
RapidContext_Widget_Icon.js, line 233

(static) LAYOUT

The layout icon definition.

Source:
RapidContext_Widget_Icon.js, line 498

(static) LEFT

The left icon definition.

Source:
RapidContext_Widget_Icon.js, line 218

(static) LIKE

The like icon definition.

Source:
RapidContext_Widget_Icon.js, line 323

(static) LINECHART

The line chart icon definition.

Source:
RapidContext_Widget_Icon.js, line 428

(static) LOADING

The loading icon definition.

Source:
RapidContext_Widget_Icon.js, line 148

(static) LOCK

The lock icon definition.

Source:
RapidContext_Widget_Icon.js, line 573

(static) MINUS

The minus icon definition.

Source:
RapidContext_Widget_Icon.js, line 253

(static) MONITOR

The monitor icon definition.

Source:
RapidContext_Widget_Icon.js, line 698

(static) NEXT

The next icon definition.

Source:
RapidContext_Widget_Icon.js, line 243

(static) NO

The no icon definition.

Source:
RapidContext_Widget_Icon.js, line 198

(static) NOTE

The note icon definition.

Source:
RapidContext_Widget_Icon.js, line 648

(static) OK

The ok icon definition.

Source:
RapidContext_Widget_Icon.js, line 183

(static) OPTIONS

The options icon definition.

Source:
RapidContext_Widget_Icon.js, line 378

(static) ORGCHART

The organization chart icon definition.

Source:
RapidContext_Widget_Icon.js, line 443

(static) PACKAGE

The package icon definition.

Source:
RapidContext_Widget_Icon.js, line 683

(static) PHONE

The phone icon definition.

Source:
RapidContext_Widget_Icon.js, line 628

(static) PHONE_MOBILE

The mobile phone icon definition.

Source:
RapidContext_Widget_Icon.js, line 633

(static) PIECHART

The pie chart icon definition.

Source:
RapidContext_Widget_Icon.js, line 438

(static) PLUGIN

The plug-in icon definition.

Source:
RapidContext_Widget_Icon.js, line 528

(static) PLUGIN_ADD

The add plug-in icon definition.

Source:
RapidContext_Widget_Icon.js, line 533

(static) PLUGIN_ERROR

The plug-in error icon definition.

Source:
RapidContext_Widget_Icon.js, line 548

(static) PLUGIN_INACTIVE

The inactive plug-in icon definition.

Source:
RapidContext_Widget_Icon.js, line 543

(static) PLUGIN_REMOVE

The remove plug-in icon definition.

Source:
RapidContext_Widget_Icon.js, line 538

(static) PLUS

The plus icon definition.

Source:
RapidContext_Widget_Icon.js, line 248

(static) PREVIOUS

The previous icon definition.

Source:
RapidContext_Widget_Icon.js, line 238

(static) PRINTER

The printer icon definition.

Source:
RapidContext_Widget_Icon.js, line 708

(static) RELOAD

The reload icon definition.

Source:
RapidContext_Widget_Icon.js, line 283

(static) REMOVE

The remove icon definition.

Source:
RapidContext_Widget_Icon.js, line 258

(static) RESIZE

The resize icon definition.

Source:
RapidContext_Widget_Icon.js, line 178

(static) RIGHT

The right icon definition.

Source:
RapidContext_Widget_Icon.js, line 223

(static) RSS

The RSS icon definition.

Source:
RapidContext_Widget_Icon.js, line 453

(static) SCRIPT

The script icon definition.

Source:
RapidContext_Widget_Icon.js, line 668

(static) SEARCH

The search icon definition.

Source:
RapidContext_Widget_Icon.js, line 303

(static) SELECT

The select icon definition.

Source:
RapidContext_Widget_Icon.js, line 318

(static) SERVER

The server icon definition.

Source:
RapidContext_Widget_Icon.js, line 713

(static) STOP

The stop icon definition.

Source:
RapidContext_Widget_Icon.js, line 188

(static) STYLE

The style icon definition.

Source:
RapidContext_Widget_Icon.js, line 478

(static) SUM

The sum icon definition.

Source:
RapidContext_Widget_Icon.js, line 508

(static) TABLE

The table icon definition.

Source:
RapidContext_Widget_Icon.js, line 503

(static) TAG

The tag icon definition.

Source:
RapidContext_Widget_Icon.js, line 353

(static) TAG_BLUE

The blue tag icon definition.

Source:
RapidContext_Widget_Icon.js, line 363

(static) TAG_GREEN

The green tag icon definition.

Source:
RapidContext_Widget_Icon.js, line 368

(static) TAG_RED

The red tag icon definition.

Source:
RapidContext_Widget_Icon.js, line 358

(static) TAG_YELLOW

The yellow tag icon definition.

Source:
RapidContext_Widget_Icon.js, line 373

(static) TEXTFIELD

The textfield icon definition.

Source:
RapidContext_Widget_Icon.js, line 688

(static) TEXT_FORMAT

The text format icon definition.

Source:
RapidContext_Widget_Icon.js, line 483

(static) UP

The up icon definition.

Source:
RapidContext_Widget_Icon.js, line 208

(static) USER

The user icon definition.

Source:
RapidContext_Widget_Icon.js, line 553

(static) VECTOR

The vector icon definition.

Source:
RapidContext_Widget_Icon.js, line 513

(static) WARNING

The warning icon definition.

Source:
RapidContext_Widget_Icon.js, line 413

(static) XHTML

The XHTML icon definition.

Source:
RapidContext_Widget_Icon.js, line 468

(static) YES

The yes icon definition.

Source:
RapidContext_Widget_Icon.js, line 193

Methods

addAll(…child)

Adds one or more children to this widget. This method will flatten any arrays among the arguments and ignores any null or undefined arguments. Any DOM nodes or widgets will be added to the end, and other objects will be converted to a text node first. Subclasses should normally override the addChildNode() method instead of this one, since that is the basis for DOM node insertion.

Parameters:
Name Type Attributes Description
child {string|Node|Array} <repeatable>
the children to add
Inherited From:
RapidContext.Widget#addAll
Source:
RapidContext_Widget.js, line 581

addChildNode(child)

Adds a single child DOM node to this widget. This method is sometimes overridden by child widgets in order to hide or control intermediate DOM nodes required by the widget.

Parameters:
Name Type Description
child {Widget|Node} the DOM node to add
Inherited From:
RapidContext.Widget#addChildNode
Source:
RapidContext_Widget.js, line 545

addClass(…cls)

Adds the specified CSS class names to this HTML DOM node.

Parameters:
Name Type Attributes Description
cls {string|Array} <repeatable>
the CSS class names to add
Inherited From:
RapidContext.Widget#addClass
Source:
RapidContext_Widget.js, line 343

animate(opts)

Performs a visual effect animation on this widget. This is implemented using the MochiKit.Visual effect package. All options sent to this function will be passed on to the appropriate MochiKit.Visual function.

Parameters:
Name Type Description
opts {Object} the visual effect options
Properties
Name Type Description
effect {string} the MochiKit.Visual effect name
queue {string} the MochiKit.Visual queue handling, defaults to "replace" and a unique scope for each widget (see MochiKit.Visual for full options)
Inherited From:
RapidContext.Widget#animate
Deprecated:
Use CSS animations instead.
Example:
widget.animate({ effect: "fade", duration: 0.5 });
widget.animate({ effect: "Move", transition: "spring", y: 300 });
Source:
RapidContext_Widget.js, line 502

blurAll()

Blurs (unfocuses) this DOM node and all relevant child nodes. This function will recursively blur all <a>, <button>, <input>, <textarea> and <select> child nodes found.

Inherited From:
RapidContext.Widget#blurAll
Source:
RapidContext_Widget.js, line 521

destroy()

The internal widget destructor function. This method should only be called by destroyWidget() and may be overridden by subclasses. By default this method does nothing.

Inherited From:
RapidContext.Widget#destroy
Source:
RapidContext_Widget.js, line 198

disable()

Disables this widget if it was previously enabled. This method is equivalent to calling setAttrs({ disabled: true }).

Inherited From:
RapidContext.Widget#disable
Source:
RapidContext_Widget.js, line 434

emit(event, optsopt) → {boolean}

Dispatches a single event from this DOM node. Also creates a new CustomEvent instance if needed.

Parameters:
Name Type Attributes Description
event {string/Event} the event type name or instance
opts {Object} <optional>
the event options
Properties
Name Type Attributes Default Description
async {boolean} <optional>
true the async dispatch flag
bubbles {boolean} <optional>
the event bubbles flag
cancelable {boolean} <optional>
the cancellable event flag
detail {Object} <optional>
the additional event details
Returns:
{boolean} true if event was async or not cancelled
Inherited From:
RapidContext.UI.Event#emit
Source:
rapidcontext/ui/event.mjs, line 26

enable()

Enables this widget if it was previously disabled. This is equivalent to calling setAttrs({ disabled: false }).

Inherited From:
RapidContext.Widget#enable
Source:
RapidContext_Widget.js, line 426

getChildNodes() → {Array}

Returns an array with all child DOM nodes. Note that the array is a real JavaScript array, not a dynamic NodeList. This method is sometimes overridden by child widgets in order to hide intermediate DOM nodes required by the widget.

Returns:
{Array} the array of child DOM nodes
Inherited From:
RapidContext.Widget#getChildNodes
Source:
RapidContext_Widget.js, line 533

hasClass(…cls) → {boolean}

Checks if this HTML DOM node has the specified CSS class names. Note that more than one CSS class name may be checked, in which case all must be present.

Parameters:
Name Type Attributes Description
cls {string|Array} <repeatable>
the CSS class names to check
Returns:
{boolean} true if all CSS classes were present, or false otherwise
Inherited From:
RapidContext.Widget#hasClass
Source:
RapidContext_Widget.js, line 325

hide()

Hides this widget node if it was previously visible. This method is equivalent to calling setAttrs({ hidden: true }). It is safe for all types of widgets, since it only adds the widgetHidden CSS class instead of setting the display style property.

Inherited From:
RapidContext.Widget#hide
Source:
RapidContext_Widget.js, line 480

isDisabled() → {boolean}

Checks if this widget is disabled. This method checks both the "widgetDisabled" CSS class and the disabled property. Changes to the disabled status can be made with enable(), disable() or setAttrs().

Returns:
{boolean} true if the widget is disabled, or false otherwise
Inherited From:
RapidContext.Widget#isDisabled
Source:
RapidContext_Widget.js, line 405

isHidden() → {boolean}

Checks if this widget node is hidden. This method checks for the existence of the widgetHidden CSS class. It does NOT check the actual widget visibility (the display style property set by animations for example).

Returns:
{boolean} true if the widget is hidden, or false otherwise
Inherited From:
RapidContext.Widget#isHidden
Source:
RapidContext_Widget.js, line 447

off(eventopt, selectoropt, listeneropt) → {Node}

Removes one or more previously attached event listeners. If no event details or listeners are specified, all matching handlers are removed.

Parameters:
Name Type Attributes Description
event {string} <optional>
the event type name (or space separated names)
selector {string} <optional>
the CSS selector to match for event target
listener {function} <optional>
the event handler function (or false)
Returns:
{Node} the input DOM node (for chaining calls)
Inherited From:
RapidContext.UI.Event#off
Source:
rapidcontext/ui/event.mjs, line 77

on(event, selectoropt, listener, optsopt) → {Node}

Attaches a listener function for one or more events.

Parameters:
Name Type Attributes Description
event {string} the event type name (or space separated names)
selector {string} <optional>
the CSS selector to match for event target
listener {function} the event handler function (or false)
opts {Object} <optional>
the event listener options (see addEventListener)
Properties
Name Type Attributes Description
delay {number} <optional>
an inactivity delay before calling listener
Returns:
{Node} the input DOM node (for chaining calls)
Inherited From:
RapidContext.UI.Event#on
Source:
rapidcontext/ui/event.mjs, line 44

once(event, selectoropt, listener, optsopt) → {Node}

Attaches a single event listener function. The listener will be removed the first time an event is triggered.

Parameters:
Name Type Attributes Description
event {string} the event type name (or space separated names)
selector {string} <optional>
the CSS selector to match for event target
listener {function} the event handler function (or false)
opts {Object} <optional>
the event listener options (see addEventListener)
Properties
Name Type Attributes Description
delay {number} <optional>
an inactivity delay before calling listener
Returns:
{Node} the input DOM node (for chaining calls)
Inherited From:
RapidContext.UI.Event#once
Source:
rapidcontext/ui/event.mjs, line 60

removeAll()

Removes all children to this widget. This method will also destroy and child widgets and disconnect all signal listeners. This method uses the getChildNodes() and removeChildNode() methods to find and remove the individual child nodes.

Inherited From:
RapidContext.Widget#removeAll
Source:
RapidContext_Widget.js, line 593

removeChildNode(child)

Removes a single child DOM node from this widget. This method is sometimes overridden by child widgets in order to hide or control intermediate DOM nodes required by the widget.

Note that this method will NOT destroy the removed child widget, so care must be taken to ensure proper child widget destruction.

Parameters:
Name Type Description
child {Widget|Node} the DOM node to remove
Inherited From:
RapidContext.Widget#removeChildNode
Source:
RapidContext_Widget.js, line 564

removeClass(…cls)

Removes the specified CSS class names from this HTML DOM node. Note that this method will not remove any class starting with "widget".

Parameters:
Name Type Attributes Description
cls {string|Array} <repeatable>
the CSS class names to remove
Inherited From:
RapidContext.Widget#removeClass
Source:
RapidContext_Widget.js, line 363

setAttrs(attrs)

Updates the icon or HTML DOM node attributes.

Parameters:
Name Type Description
attrs {string|Object} the icon ref, class or attributes to set
Properties
Name Type Attributes Description
ref {string} <optional>
the predefined icon name (reference)
class {string} <optional>
the icon CSS class names
url {string} <optional>
the icon image URL
position {string} <optional>
the icon image position
width {number} <optional>
the icon width (in pixels)
height {number} <optional>
the icon height (in pixels)
tooltip {string} <optional>
the icon tooltip text
disabled {boolean} <optional>
the disabled widget flag
hidden {boolean} <optional>
the hidden widget flag
Overrides:
RapidContext.Widget#setAttrs
Source:
RapidContext_Widget_Icon.js, line 95

setStyle(styles)

Updates the CSS styles of this HTML DOM node. This method is identical to MochiKit.Style.setStyle, but uses "this" as the first argument.

Parameters:
Name Type Description
styles {Object} an object with the styles to set
Inherited From:
RapidContext.Widget#setStyle
Example:
widget.setStyle({ "font-size": "bold", "color": "red" });
Source:
RapidContext_Widget.js, line 302

show()

Shows this widget node if it was previously hidden. This method is equivalent to calling setAttrs({ hidden: false }). It is safe for all types of widgets, since it only removes the widgetHidden CSS class instead of setting the display style property.

Inherited From:
RapidContext.Widget#show
Source:
RapidContext_Widget.js, line 470

toggleClass(…cls) → {boolean}

Toggles adding and removing the specified CSS class names to and from this HTML DOM node. If all the CSS classes are already set, they will be removed. Otherwise they will be added.

Parameters:
Name Type Attributes Description
cls {string|Array} <repeatable>
the CSS class names to remove
Returns:
{boolean} true if the CSS classes were added, or false otherwise
Inherited From:
RapidContext.Widget#toggleClass
Source:
RapidContext_Widget.js, line 386

uid() → {string}

Returns the unique identifier for this DOM node. If a node id has already been set, that id will be returned. Otherwise a new id will be generated and assigned to the widget DOM node.

Returns:
{string} the the unique DOM node identifier
Inherited From:
RapidContext.Widget#uid
Source:
RapidContext_Widget.js, line 186