Function
Base class for all Dijit widgets.
String
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.
String
Rarely used. Overrides the default Dojo locale used to render this widget, as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute. Value must be among the list of locales specified during by the Dojo bootstrap, formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
String
Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir) attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's default direction.
String
HTML class attribute
String||Object
HTML style attributes as cssText string or name/value hash
String
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.
String
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.
String
Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate widget state.
DomNode
pointer to original DOM node
DomNode
This is our visible representation of the widget! Other DOM Nodes may by assigned to other properties, usually through the template system's dojoAttachPoint syntax, but the domNode property is the canonical "top level" node in widget UI.
DomNode
Designates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets. For example, for myWidget: <div dojoType=myWidget> <b> here's a plain DOM node <span dojoType=subWidget>and a widget</span> <i> and another plain DOM node </i> </div> containerNode would point to: <b> here's a plain DOM node <span dojoType=subWidget>and a widget</span> <i> and another plain DOM node </i> In templated widgets, "containerNode" is set via a dojoAttachPoint 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.
Boolean
startup() has completed.
Object
Object
Function
Event
Connect to this function to receive notifications of mouse click events.
Function
Event
Connect to this function to receive notifications of mouse double click events.
Function
Event
Connect to this function to receive notifications of keys being pressed down.
Function
Event
Connect to this function to receive notifications of printable keys being typed.
Function
Event
Connect to this function to receive notifications of keys being released.
Function
Event
Connect to this function to receive notifications of when the mouse button is pressed down.
Function
Event
Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
Function
Event
Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
Function
Event
Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
Function
Event
Connect to this function to receive notifications of when the mouse moves off of this widget.
Function
Event
Connect to this function to receive notifications of when the mouse moves onto this widget.
Function
Event
Connect to this function to receive notifications of when the mouse button is released.
String
Path to a blank 1x1 image. Used by <img> nodes in templates that really get their image via CSS background-image.
Function
Kicks off widget instantiation. See create() for details.
Function
Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick.
If a srcNodeRef (DOM node) is specified: - use srcNodeRef.innerHTML as my contents - if this is a behavioral widget then apply behavior to that srcNodeRef - otherwise, replace srcNodeRef with my generated DOM tree
Kick off the life-cycle of a widget
Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate, etc.), some of which of you'll want to override. See http://docs.dojocampus.org/dijit/_Widget for a discussion of the widget creation lifecycle. Of course, adventurous developers could override create entirely, but this should only be done as a last resort.
String[]
Function
Step during widget creation to copy all widget attributes to the DOM as per attributeMap and _setXXXAttr functions.
Skips over blank/false attribute values, unless they were explicitly specified as parameters to the widget, since those are the default anyway, and setting tabIndex="" is different than not setting tabIndex at all. It processes the attributes in the attribute map first, and then it goes through and processes the attributes for the _setXXXAttr functions that have been specified
Function
Called after the parameters to the widget have been read-in, but before the widget template is instantiated. Especially useful to set properties that are referenced in the widget template.
Function
Construct the UI for this widget, setting this.domNode
Most widgets will mixin `dijit._Templated`, which implements this method.
Function
Processing after the DOM fragment is created
Called after the DOM fragment has been created, but not necessarily added to the document. Do not include any operations which rely on node dimensions or placement.
String[]
Function
Processing after the DOM fragment is added to the document
Called after a widget and its children have been created and added to the page, and all related widgets have finished their create() cycle, up through postCreate(). This is useful for composite widgets that need to control or layout sub-widgets. Many layout widgets can use this as a wiring phase.
Function
If true, this method will leave the original DOM structure alone of descendant Widgets. Note: This will NOT work with dijit._Templated widgets.
Destroy this widget and its descendants
This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it is removed from the manager object.
Function
If true, this method will leave the original DOM structure alone. Note: This will not yet work with _Templated widgets
Destroy this widget, but not its descendants. This method will, however, destroy internal widgets such as those used within a template.
Function
If true, this method will leave the original DOM structure alone during tear-down. Note: this will not work with _Templated widgets yet.
Destroys the DOM nodes associated with this widget
Function
Recursively destroy the children of this widget and their descendants.
String[]
Function
Stub function. Override to implement custom widget tear-down behavior.
Function
Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
Function
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.
Function
This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.
Function
This is where widgets do processing for when they stop being active, such as changing CSS classes. See onBlur() for more details.
Function
Called when someone connects to one of my handlers. "Turn on" that handler if it isn't active yet. This is also called for every single initialization parameter so need to do nothing for parameters like "id".
Function
Custom setter for the CSS "class" attribute
Function
Sets the style attribut of the widget according to value,
which is either a hash like {height: "5px", width: "3px"}
or a plain stringDetermines which node to set the style on based on style setting in attributeMap.
Function
Deprecated. Use set() instead.
Function
Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified in attributeMap.
Also sets this["attr"] to the new value. Note some attributes like "type" cannot be processed this way as they are not mutable.
Function
The property to get or set. If an object is passed here and not a string, its keys are used as names of attributes to be set and the value of the object as values to set in the widget.
Optional. If provided, attr() operates as a setter. If omitted, the current value of the named property is returned.
Set or get properties on a widget instance.
String[]
Function
property to get.
Get a property from a widget.
Get a named property from a widget. The property may
potentially be retrieved via a getter method. If no getter is defined, this
just retrieves the object's property.
For example, if the widget has a properties "foo"
and "bar" and a method named "_getFooAttr", calling:
myWidget.get("foo");
would be equivalent to writing:
widget._getFooAttr();
and:
myWidget.get("bar");
would be equivalent to writing:
widget.bar;Function
property to set.
value to set in the property.
Set a property on a widget
Sets named properties on a widget which may potentially be handled by a
setter in the widget.
For example, if the widget has a properties "foo"
and "bar" and a method named "_setFooAttr", calling:
myWidget.set("foo", "Howdy!");
would be equivalent to writing:
widget._setFooAttr("Howdy!");
and:
myWidget.set("bar", 3);
would be equivalent to writing:
widget.bar = 3;
set() may also be called with a hash of name/value pairs, ex:
myWidget.set({
foo: "Howdy",
bar: 3
})
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)Object
Function
Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.
Function
Returns a string that represents the widget
When a widget is cast to a string, this method will be used to generate the output. Currently, it does not implement any sort of reversible serialization.
String
Function
Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. This method should generally be avoided as it returns widgets declared in templates, which are supposed to be internal/hidden, but it's left here for back-compat reasons.
dijit._Widget[]
Function
Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. Does not return nested widgets, nor widgets that are part of this widget's template.
dijit._Widget[]
String[
List of nodes that correctly handle click events via native browser support, and don't need dijit's help
Function
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. This version of connect also provides a special "ondijitclick" event which triggers on a click or space or enter keyup
A handle that can be passed to `disconnect` in order to disconnect before the widget is destroyed.
_Widget.Handle
var btn = new dijit.form.Button();
// when foo.bar() is called, call the listener we're going to
// provide in the scope of btn
btn.connect(foo, "bar", function(){
console.debug(this.toString());
});Function
Disconnects handle created by `connect`. Also removes handle from this widget's list of connects.
Function
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.
var btn = new dijit.form.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);
});Function
Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions
Function
Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
Boolean
Function
Return true if this widget can currently be focused and false if not
Function
The String id of a domNode, a domNode reference, or a reference to a Widget posessing an addChild method.
If passed a string or domNode reference, the position argument accepts a string just as dojo.place does, one of: "first", "last", "before", or "after". If passed a _Widget reference, and that widget reference has an ".addChild" method, it will be called passing this widget instance into that method, supplying the optional position index passed.
Place this widget's domNode reference somewhere in the DOM based on standard dojo.place conventions, or passing a Widget reference that contains and addChild member.
A convenience function provided in all _Widgets, providing a simple shorthand mechanism to put an existing (or newly created) Widget somewhere in the dom, and allow chaining.
dijit._Widget Provides a useful return of the newly created dijit._Widget instance so you can "chain" this function by instantiating, placing, then saving the return value to a variable.
// create a Button with no srcNodeRef, and place it in the body:
var button = new dijit.form.Button({ label:"click" }).placeAt(dojo.body());
// now, 'button' is still the widget reference to the newly created button
dojo.connect(button, "onClick", function(e){ console.log('click'); });
// create a button out of a node with id="src" and append it to id="wrapper":
var button = new dijit.form.Button({},"src").placeAt("wrapper");
// place a new button as the first element of some div
var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
// create a contentpane and add it to a TabContainer
var tc = dijit.byId("myTabs");
new dijit.layout.ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)Function
Internal method called when this widget is made visible. See `onShow` for details.
Function
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`.
Function
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`.
Function
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.
Boolean
Hash
of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick.
If
a srcNodeRef (DOM node) is specified: - use srcNodeRef.innerHTML as my contents - if this is a behavioral widget then apply behavior to that srcNodeRef - otherwise, replace srcNodeRef with my generated DOM tree
Function
Function
Returns list of attributes with custom setters for specified widget
String[]
Object
Object