In templated widgets, "containerNode" is set via a
data-dojo-attach-point assignment.

containerNode must be defined for any widget that accepts innerHTML
(like ContentPane or BorderContainer or even Button), and conversely
is null for widgets that don't, like TextBox.

contextTypeName

Type name for the context we can handle

dir

Bi-directional support, as defined by the HTML DIR
attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
default direction.

dndType

Defines a type of widget.

domNode

This is our visible representation of the widget! Other DOM
Nodes may by assigned to other properties, usually through the
template system's data-dojo-attach-point syntax, but the domNode
property is the canonical "top level" node in widget UI.

focused

This widget or a widget it contains has focus, or is "active" because
it was recently clicked.

id

A unique, opaque ID string that can be assigned by users or by the
system. If the developer passes an ID which is known not to be
unique, the specified ID is ignored and the system-generated ID is
used instead.

iFrame

The iframe widget

iframeWithOverlay

The IframeWithOverlay widget

lang

Rarely used. Overrides the default Dojo locale used to render this widget,
as defined by the HTML LANG attribute.
Value must be among the list of locales specified during by the Dojo bootstrap,
formatted according to RFC 3066 (like en-us).

layoutContainer

The layout container

overlay

ownerDocument

The document this widget belongs to. If not specified to constructor, will default to
srcNodeRef.ownerDocument, or if no sourceRef specified, then to dojo/_base/window::doc

srcNodeRef

pointer to original DOM node

style

HTML style attributes as cssText string or name/value hash

textDir

Bi-directional support, the main variable which is responsible for the direction of the text.
The text direction can be different than the GUI direction by using this parameter in creation
of a widget.

Allowed values:

"ltr"

"rtl"

"auto" - contextual the direction of a text defined by first strong letter.

By default is as the page direction.

title

HTML title attribute.

For form widgets this specifies a tooltip to display when hovering over
the widget (just like the native HTML title attribute).

For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
etc., it's used to specify the tab label, accordion pane title, etc.

tooltip

When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
this specifies the tooltip to appear when the mouse is hovered over that text.

viewModel

The content view model.

Methods

_onBlur ( )

This is where widgets do processing for when they stop being active,
such as changing CSS classes. See onBlur() for more details.

_onFocus ( )

This is where widgets do processing for when they are active,
such as changing CSS classes. See onFocus() for more details.

_setStyleAttr ( value
)

Sets the style attribute of the widget according to value,
which is either a hash like {height: "5px", width: "3px"}
or a plain string

Parameters

Name

Summary

Type

Usage

value

String||Object

required

applyTextDir ( element , text
)

The function overridden in the _BidiSupport module,
originally used for setting element.dir according to this.textDir.
In this case does nothing.

Parameters

Name

Summary

Type

Usage

element

DOMNode

required

text

String

required

buildRendering ( )

Construct the UI for this widget, setting this.domNode.
Most widgets will mixin dijit._TemplatedMixin, which implements this method.

connect ( obj , event , method
)

Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.

Connects specified obj/event to specified method of this object
and registers for disconnect() on widget destroy.

Provide widget-specific analog to dojo.connect, except with the
implicit use of this widget as the target object.
Events connected with this.connect are disconnected upon
destruction.

Wrapper to setTimeout to avoid deferred functions executing
after the originating widget has been destroyed.
Returns an object handle with a remove method (that returns null) (replaces clearTimeout).

Parameters

Name

Summary

Type

Usage

fcn

undefined

required

delay

undefined

required

destroyRendering ( preserveDom
)

Destroys the DOM nodes associated with this widget

Parameters

Name

Summary

Type

Usage

preserveDom

If true, this method will leave the original DOM structure alone
during tear-down. Note: this will not work with _Templated
widgets yet.

Boolean

optional

disconnect ( handle
)

Deprecated, will be removed in 2.0, use handle.remove() instead.

Disconnects handle created by connect.

Parameters

Name

Summary

Type

Usage

handle

undefined

required

emit ( type , eventObj , callbackArgs
)

Used by widgets to signal that a synthetic event occurred, ex:

myWidget.emit("attrmodified-selectedChildWidget", {}).

Emits an event on this.domNode named type.toLowerCase(), based on eventObj.
Also calls onType() method, if present, and returns value from that method.
By default passes eventObj to callback, but will pass callbackArgs instead, if specified.
Modifies eventObj by adding missing parameters (bubbles, cancelable, widget).

Parameters

Name

Summary

Type

Usage

type

String

required

eventObj

Object

optional

callbackArgs

Array

optional

getTextDir ( text , originalDir
)

Return direction of the text.
The function overridden in the _BidiSupport module,
its main purpose is to calculate the direction of the
text, if was defined by the programmer through textDir.

Parameters

Name

Summary

Type

Usage

text

String

required

originalDir

String

required

isLeftToRight ( )

Return this widget's explicit or implicit orientation (true for LTR, false for RTL)

onBlur ( )

Called when the widget stops being "active" because
focus moved to something outside of it, or the user
clicked somewhere outside of it, or the widget was
hidden.

onClick ( event
)

Connect to this function to receive notifications of mouse click events.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onClose ( )

Called when this widget is being displayed as a popup (ex: a Calendar popped
up from a DateTextBox), and it is hidden.
This is called from the dijit.popup code, and should not be called directly.

Also used as a parameter for children of dijit/layout/StackContainer or subclasses.
Callback if a user tries to close the child. Child will be closed if this function returns true.

onDblClick ( event
)

Connect to this function to receive notifications of mouse double click events.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onFocus ( )

Called when the widget becomes "active" because
it or a widget inside of it either has focus, or has recently
been clicked.

onHide ( )

Called when another widget becomes the selected pane in a
dijit/layout/TabContainer, dijit/layout/StackContainer,
dijit/layout/AccordionContainer, etc.

Also called to indicate hide of a dijit.Dialog, dijit.TooltipDialog, or dijit.TitlePane.

onKeyDown ( event
)

Connect to this function to receive notifications of keys being pressed down.

Parameters

Name

Summary

Type

Usage

event

key Event

undefined

required

onKeyPress ( event
)

Connect to this function to receive notifications of printable keys being typed.

Parameters

Name

Summary

Type

Usage

event

key Event

undefined

required

onKeyUp ( event
)

Connect to this function to receive notifications of keys being released.

Parameters

Name

Summary

Type

Usage

event

key Event

undefined

required

onMouseDown ( event
)

Connect to this function to receive notifications of when the mouse button is pressed down.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseEnter ( event
)

Connect to this function to receive notifications of when the mouse moves onto this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseLeave ( event
)

Connect to this function to receive notifications of when the mouse moves off of this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseMove ( event
)

Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseOut ( event
)

Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseOver ( event
)

Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseUp ( event
)

Connect to this function to receive notifications of when the mouse button is released.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onPrepareOverlayComplete ( )

Overlay preparation is complete

onShow ( )

Called when this widget becomes the selected pane in a
dijit/layout/TabContainer, dijit/layout/StackContainer,
dijit/layout/AccordionContainer, etc.

Also called to indicate display of a dijit.Dialog, dijit.TooltipDialog, or dijit.TitlePane.

own ( )

Track specified handles and remove/destroy them when this instance is destroyed, unless they were
already removed/destroyed manually.

setAttribute ( attr , value
)

Deprecated. Use set() instead.

Parameters

Name

Summary

Type

Usage

attr

String

required

value

anything

required

subscribe ( t , method
)

Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.

Subscribes to the specified topic and calls the specified method
of this object and registers for unsubscribe() on widget destroy.

Provide widget-specific analog to dojo.subscribe, except with the
implicit use of this widget as the target object.

Parameters

Name

Summary

Type

Usage

t

The topic

String

required

method

The callback

Function

required

Examples

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
this.set("label", v);
});