Class Index | File Index

Classes


Class glow.ui.Widget


Extends glow.events.Target.

Defined in: ui.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
glow.ui.Widget(name, opts)
An abstract Widget class The Widget class serves as a base class that provides a shared framework on which other, more specific, widgets can be implemented.
Field Summary
Field Attributes Field Name and Description
 
The outermost wrapper element of the widget.
 
The content element of the widget This is inside various wrapper elements used to track the state of the widget.
 
The phase within the lifecycle of the widget.
Method Summary
Method Attributes Method Name and Description
 
Cause any functionality that deals with removing and deleting this widget to run.
 
disabled(newState)
Enable/disable the Widget, or get the disabled state If other widgets are synced with this one, they will become disabled too.
Methods borrowed from class glow.events.Target:
detach, fire, on
Event Summary
Event Attributes Event Name and Description
 
Fired when destroy is called on this widget.
 
Fired after the disabled property is changed via the glow.ui.Widget#disable or glow.ui.Widget#enable method.
Class Detail
glow.ui.Widget(name, opts)
An abstract Widget class The Widget class serves as a base class that provides a shared framework on which other, more specific, widgets can be implemented. While it is possible to create an instance of this generic widget, it is more likely that your widget class will extend this class. Your widget constructor should call the base constructor, and should end in a call to _init.
			function MyWidget(opts) {
				// set up your widget...
				// call the base constructor, passing in the name and the options
				glow.ui.Widget.call(this, 'MyWidget', opts);
				
				// start init
				this._init();
			}
			glow.util.extend(MyWidget, glow.ui.Widget);
Parameters:
{string} name
The name of this widget. This is added to class names in the generated DOM nodes that wrap the widget interface.
{object} opts Optional
{string} opts.className Optional
Class name to add to the container.
{string} opts.id Optional
Id to add to the container.
Field Detail
{glow.NodeList} container
The outermost wrapper element of the widget.

{glow.NodeList} content
The content element of the widget This is inside various wrapper elements used to track the state of the widget.

{string} phase
The phase within the lifecycle of the widget. Will be one of the following:
constructed
The widget has been constructed but not yet initialised
initialised
The widget has been initialised but not yet build
built
The widget has been built but not yet bound
ready
The widget is in a fully usable state
destroyed
The widget has been destroyed
Usually, init, build & bind are done in the constructor, so you may only interact with a widget that is either 'ready' or 'destroyed'.
Method Detail
destroy()
Cause any functionality that deals with removing and deleting this widget to run. By default the container and all it's contents are removed.

disabled(newState)
Enable/disable the Widget, or get the disabled state If other widgets are synced with this one, they will become disabled too.
			var a = new MyWidget();
			var b = new MyWidget();
			var c = new MyWidget();
			
			c._tie(a, b);
			
			c.disabled(true); // a, b, and c are now disabled
Parameters:
{boolean} newState Optional
Disable the focusable? 'false' will enable a disabled focusable.
Event Detail
destroy()
Fired when destroy is called on this widget.
See:
glow.ui.Widget#destroy

disable()
Fired after the disabled property is changed via the glow.ui.Widget#disable or glow.ui.Widget#enable method. This includes widgets that are changed as a result of being synced to this one.

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Jun 14 2010 14:24:10 GMT+0100 (BST)