Class BaseWidget
- Version
- 0.1
- Defined in
- jswidgets-0.1.js
This is the object that defines the base functionality from which all other JSWidgets will extend.
Constructor Attributes | Constructor Name and Description |
---|---|
BaseWidget(id, mgr, opts)
This is the base widget from which all others extend
|
Field Attributes | Field Name and Description |
---|---|
Configuration of the current widget.
|
|
The name of the current widget (should be overwritten by all child classes).
|
Method Attributes | Method Name and Description |
---|---|
appendContent(val)
Appends the content as a new line to the widget's content area
|
|
destroy()
Destroy the current widget from the DOM and cleanup
|
|
getTitle()
Returns the configured title of this widget.
|
|
setContent(val)
Defines the content to replace into the current widget
|
|
setManager(mgr)
|
|
setTitle(val)
Set the content for the title region of the widget
|
|
setUid(id)
Set the object's UID to the provided
id |
|
An accessor method that allows this widget to remove itself from the manager implicitly.
|
|
valid()
|
|
validate(opts)
Validate the bare minimum opts are present
This method should be overridden by all widgets
|
Event Attributes | Event Name and Description |
---|---|
load(w)
Load event is triggered when the widget has completed loading.
|
Class Detail
BaseWidget(id, mgr, opts)
This is the base widget from which all others extend
Author: Garth Henson (Guahan Web).
Author: Garth Henson (Guahan Web).
Field Detail
{Object}
config
Configuration of the current widget. This is loaded by the
opts
parameter in the
object constructor. Valid configuration options are:
- listeners - event handlers for the following custom events:
- load - executed once the widget has loaded
- title_selector - defaults to '.title'
- content_selector - defaults to '.content'
- title - defaults to the widget name
{String}
name
The name of the current widget (should be overwritten by all child classes).
Method Detail
appendContent(val)
Appends the content as a new line to the widget's content area
- Parameters:
- {string} val
- The value to append
{string}
getTitle()
Returns the configured title of this widget. Defaults to the widget name if no title has been set.
- Returns:
- {string} The widget's title
setContent(val)
Defines the content to replace into the current widget
- Parameters:
- {String} val
- The raw markup to be inserted into the content region
setTitle(val)
Set the content for the title region of the widget
- Parameters:
- {string} val
- The new title to display
unregister()
An accessor method that allows this widget to remove itself from the manager implicitly.
{boolean}
validate(opts)
Validate the bare minimum opts are present
This method should be overridden by all widgets
- Parameters:
- opts
- Returns:
- {boolean} Whether or not this widget is valid
Event Detail
load(w)
Load event is triggered when the widget has completed loading.
- Parameters:
- {BaseWidget} w
- The widget object which was loaded