dojox/form/DropDownSelect (version 1.10)

dijit/form/_FormSelectWidget, dijit/_HasDropDown, dijit/_KeyNavMixin

Usage

var foo = new DropDownSelect(params,srcNodeRef);
dijit/form/_FormSelectWidget
Parameter Type Description
params Object | null

Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties.

srcNodeRef DOMNode | String
Optional

If a srcNodeRef (DOM node) is specified, replace srcNodeRef with my generated DOM tree

See the dojox/form/DropDownSelect reference documentation for more information.

Property Summary

  • _aroundNodeThe node to display the popup around.
  • _arrowWrapperNodeWill set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending on where the drop down is set to be positioned.
  • _attachEventsList of connections associated with data-dojo-attach-event=... in the template
  • _attachPointsList of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
  • _attrPairNames
  • _blankGifPath to a blank 1x1 image.
  • _buttonInputDisabled
  • _buttonNodeThe button/icon/node to click to display the drop down.
  • _childrenLoadedWhether or not our children have been loaded
  • _focusManager
  • _isLoadedWhether or not we have been loaded
  • _keyNavCodesHash mapping key code (arrow keys and home/end key) to functions to handle those keys.
  • _onChangeActiveIndicates that changes to the value should call onChange() callback.
  • _onContainerKeydown
  • _onContainerKeypress
  • _popupStateNodeThe node to set the aria-expanded class on.
  • _renderedNot normally use, but this flag can be set by the app if the server has already rendered the template, i.e. already inlining the template for the widget into the main page.
  • _searchString
  • _setClassAttr
  • _setDirAttr
  • _setIdAttr
  • _setLangAttr
  • _setNameAttr
  • _setTabIndexAttr
  • _setTypeAttr
  • _skipNodeCache
  • _startedstartup() has completed.
  • _stopClickEventsWhen set to false, the click events will not be stopped, in case you want to use them in your subclass
  • activeTrue if mouse was pressed while over this widget, and hasn't been released yet
  • altCorresponds to the native HTML <input> element's attribute.
  • aria-label
  • attachScopeObject to which attach points and events will be scoped.
  • attributeMapDeprecated.
  • autoWidthSet to true to make the drop down at least as wide as this widget.
  • baseClass
  • class
  • containerNodeDesignates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets.
  • cssStateNodesSubclasses may define a cssStateNodes property that lists sub-nodes within the widget that need CSS classes applied on mouse hover/press and focus.
  • dirBi-directional support, as defined by the HTML DIR attribute.
  • disabledShould this widget respond to user input?
  • domNodeThis is our visible representation of the widget!
  • dropDownThe widget to display as a popup.
  • dropDownPositionThis variable controls the position of the drop down.
  • emptyLabelWhat to display in an "empty" dropdown
  • focusedThis widget or a widget it contains has focus, or is "active" because it was recently clicked.
  • focusedChildThe currently focused child widget, or null if there isn't one
  • forceWidthSet to true to make the drop down exactly as wide as this widget.
  • hoveringTrue if cursor is over this widget
  • idA unique, opaque ID string that can be assigned by users or by the system.
  • intermediateChangesFires onChange for each value change or only on demand
  • labelAttrThe entries in the drop down list come from this attribute in the dojo.store items.
  • labelTypeSpecifies how to interpret the labelAttr in the data store items.
  • langRarely used.
  • loadChildrenOnOpenBy default loadChildren is called when the items are fetched from the store.
  • maxHeightThe max height for our dropdown.
  • messageCurrently displayed error/prompt message
  • multiCharSearchDurationIf multiple characters are typed where each keystroke happens within multiCharSearchDuration of the previous keystroke, search for nodes matching all the keystrokes.
  • multipleWhether or not we are multi-valued
  • nameName used when submitting form; same as "name" attribute or plain HTML elements
  • onFetchA callback to do with an onFetch - but before any items are actually iterated over (i.e. to filter even further what you want to add)
  • onLoadDeferredThis is the dojo.Deferred returned by setStore().
  • optionsThe set of options for our select item.
  • ownerDocumentThe document this widget belongs to.
  • queryA query to use when fetching items from our store
  • queryOptionsQuery options to use when fetching from the store
  • readOnlyShould this widget respond to user input?
  • requiredCan be true or false, default is false.
  • scrollOnFocusOn focus, should this widget scroll into view?
  • searchContainerNode
  • sortByLabelFlag to sort the options returned from a store by the label of the store.
  • srcNodeRefpointer to original DOM node
  • state"Incomplete" if this select is required but unset (i.e. blank value), "" otherwise
  • storeA store to use for getting our list of options - rather than reading them from the <option> html tags.
  • styleHTML style attributes as cssText string or name/value hash
  • tabIndexOrder fields are traversed when user hits the tab key
  • templatePathPath to template (HTML file) for this widget relative to dojo.baseUrl.
  • templateString
  • titleHTML title attribute.
  • tooltipWhen 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.
  • tooltipPositionSee description of dijit/Tooltip.defaultPosition for details on this parameter.
  • typeCorresponds to the native HTML <input> element's attribute.
  • valueCorresponds to the native HTML <input> element's attribute.

Method Summary

  • _addOptionForItem(item) Creates (and adds) the option for the given item
  • _addOptionItem(option) For the given option, add an option to our dropdown.
  • _applyAttributes() Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.
  • _attach(node,type,func) Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event.
  • _attachTemplateNodes(rootNode) Iterate through the dom nodes and attach functions and nodes accordingly.
  • _attrToDom(attr,value,commands) Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter.
  • _beforeFillContent()
  • _changeAttrValue(name,value) Internal helper for directly changing an attribute value.
  • _cssMouseEvent(event) Handler for CSS event on this.domNode.
  • _deprecatedSetStore(store,selectedValue,fetchArgs) Sets the store you would like to use with this select widget.
  • _detachTemplateNodes() Detach and clean up the attachments made in _attachtempalteNodes.
  • _escapeValue(val) Escape a value to be inserted into the template, either into an attribute value (ex: foo="${bar}") or as inner text of an element (ex: ${foo})
  • _fillContent() Set the value to be the first, or the selected index
  • _get(name) Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters.
  • _getAttrNames(name) Helper function for get() and set().
  • _getChildren()
  • _getDisplayedValueAttr() returns the displayed value of the widget
  • _getFirst() Returns the first child widget.
  • _getFirstFocusableChild() Returns first child that can be focused.
  • _getLast() Returns the last child widget.
  • _getLastFocusableChild() Returns last child that can be focused.
  • _getMenuItemForOption(option) For the given option, return the menu item that should be used to display it.
  • _getNext(child,dir) Returns the next descendant, compared to "child".
  • _getNextFocusableChild(child,dir) Returns the next or previous focusable descendant, compared to "child".
  • _getOptionObjForItem(item) Returns an option object based off the given item.
  • _getSelectedOptionsAttr() hooks into this.attr to provide a mechanism for getting the option items for the current value of the widget.
  • _getValueFromOpts() Returns the value of the widget by reading the options for the selected flag
  • _handleOnChange(newValue,priorityChange) Called when the value of the widget is set.
  • _introspect() Collect metadata about this widget (only once per class, not once per instance): - list of attributes with custom setters, storing in this.constructor._setterAttrs - generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
  • _keyboardSearch(evt,keyChar) Perform a search of the widget's options based on the user's keyboard activity
  • _keyboardSearchCompare(item,searchString) Compares the searchString to the widget's text label, returning: * -1: a high priority match and stop searching * 0: not a match * 1: a match but keep looking for a higher priority match
  • _layoutHackIE7() Work around table sizing bugs on IE7 by forcing redraw
  • _loadChildren(loadMenuItems) Resets the menu and the length attribute of the button - and ensures that the label is appropriately set.
  • _Menu()
  • _processTemplateNode(baseNode,getAttrFunc,attachFunc) Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
  • _pseudoLoadChildren(items) a function that will "fake" loading children, if needed, and if we have set to not load children until the widget opens.
  • _refreshState()
  • _removeOptionItem(option) User-overridable function which, for the given option, removes its item from the select.
  • _set(name,value) Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.
  • _setDisabledAttr(value)
  • _setDisplay(newDisplay)
  • _setDisplayedValueAttr(label) Sets the displayed value of the widget
  • _setFocusedAttr(val)
  • _setOptionsAttr(options)
  • _setOwnerDocumentAttr(val)
  • _setQueryAttr(query)
  • _setQueryOptionsAttr(queryOptions)
  • _setReadOnlyAttr(value)
  • _setRequiredAttr(value)
  • _setStateClass() Update the visual state of the widget by setting the css classes on this.domNode (or this.stateNode if defined) by combining this.baseClass with various suffixes that represent the current widget state(s).
  • _setStoreAttr(val)
  • _setStyleAttr(value)
  • _setValueAttr(value)
  • _stringRepl(tmpl) Does substitution of ${foo} type properties in template string
  • _subnodeCssMouseEvent(node,clazz,evt) Handler for hover/active mouse event on widget's subnode
  • _trackMouseState(node,clazz) Track mouse/focus events on specified node and set CSS class on that node to indicate current state.
  • _updateSelection() Sets the "selected" class on the item for styling purposes
  • addOption(option) Adds an option or options to the end of the select.
  • attr(name,value) This method is deprecated, use get() or set() directly.
  • buildRendering()
  • childSelector(node)
  • closeDropDown(focus) Closes the drop down on this widget
  • compare(val1,val2) Compare 2 values (as returned by get('value') for this widget).
  • connect(obj,event,method) Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
  • create(params,srcNodeRef) Kick off the life-cycle of a widget
  • defer(fcn,delay) Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed.
  • destroy(preserveDom)
  • destroyDescendants(preserveDom) Recursively destroy the children of this widget and their descendants.
  • destroyRecursive(preserveDom) Destroy this widget and its descendants
  • destroyRendering(preserveDom) Destroys the DOM nodes associated with this widget.
  • disconnect(handle) Deprecated, will be removed in 2.0, use handle.remove() instead.
  • emit(type,eventObj,callbackArgs) Used by widgets to signal that a synthetic event occurred, ex: myWidget.emit("attrmodified-selectedChildWidget", {}).
  • focus()
  • focusChild(widget) Sets the value to the given option, used during search by letter.
  • focusFirstChild() Focus the first focusable child in the container.
  • focusLastChild() Focus the last focusable child in the container.
  • get(name) Get a property from a widget.
  • getChildren() Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget.
  • getDescendants() Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
  • getOptions(valueOrIdx) Returns a given option (or options).
  • getParent() Returns the parent widget of this widget.
  • getValue() Deprecated.
  • isFocusable() Return true if this widget can currently be focused and false if not
  • isLeftToRight() Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
  • isLoaded()
  • isValid(isFocused) Whether or not this is a valid value.
  • loadAndOpenDropDown() Creates the drop down if it doesn't exist, loads the data if there's an href and it hasn't been loaded yet, and then opens the drop down.
  • loadDropDown(loadCallback) populates the menu
  • on(type,func)
  • openDropDown() Opens the dropdown for this widget.
  • own() Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
  • placeAt(reference,position) Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.
  • postCreate()
  • postMixInProperties() set the missing message
  • postscript(params,srcNodeRef) Kicks off widget instantiation.
  • removeOption(valueOrIdx) Removes the given option or options.
  • reset() Overridden so that the state will be cleared.
  • set(name,value) Set a property on a widget
  • setAttribute(attr,value) Deprecated.
  • setDisabled(disabled) Deprecated.
  • setStore(store,selectedValue,fetchArgs)
  • setValue(value) Deprecated.
  • startup()
  • subscribe(t,method) Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
  • toggleDropDown() Callback when the user presses the down arrow button or presses the down arrow key to open/close the drop down.
  • toString() Returns a string that represents the widget.
  • undo() Restore the value to the last value passed to onChange
  • uninitialize() Deprecated.
  • unsubscribe(handle) Deprecated, will be removed in 2.0, use handle.remove() instead.
  • updateOption(newOption) Updates the values of the given option.
  • validate(isFocused) Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
  • watch(name,callback) Watches a property for changes

Event Summary

  • _onBlur()
  • _onChildBlur(widget) Called when focus leaves a child widget to go to a sibling widget.
  • _onChildFocus(child) Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
  • _onContainerFocus(evt) Handler for when the container itself gets focus.
  • _onDeleteItem(item)
  • _onDownArrow() Called on down arrow key.
  • _onDropDownClick(e)
  • _onDropDownMouseDown(e) Callback when the user mousedown/touchstart on the arrow icon.
  • _onDropDownMouseUp(e) Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
  • _onFocus()
  • _onKey(e) Callback when the user presses a key while focused on the button node
  • _onKeyUp()
  • _onLeftArrow() Called on left arrow key, or right arrow key if widget is in RTL mode.
  • _onMap(type) Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove").
  • _onNewItem(item,parentInfo)
  • _onRightArrow() Called on right arrow key, or left arrow key if widget is in RTL mode.
  • _onSetItem(item)
  • _onShow() Internal method called when this widget is made visible.
  • _onUpArrow() Called on up arrow key.
  • 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.
  • onChange(newValue) Callback when this widget's value is changed.
  • onClick(event) Connect to this function to receive notifications of mouse click events.
  • onClose() Called when this widget is being displayed as a popup (ex: a Calendar popped up from a DateTextBox), and it is hidden.
  • onDblClick(event) Connect to this function to receive notifications of mouse double click events.
  • 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.
  • onKeyboardSearch(item,evt,searchString,numMatches) When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
  • onKeyDown(event) Connect to this function to receive notifications of keys being pressed down.
  • onKeyPress(event) Connect to this function to receive notifications of printable keys being typed.
  • onKeyUp(event) Connect to this function to receive notifications of keys being released.
  • onMouseDown(event) Connect to this function to receive notifications of when the mouse button is pressed down.
  • onMouseEnter(event) Connect to this function to receive notifications of when the mouse moves onto this widget.
  • onMouseLeave(event) Connect to this function to receive notifications of when the mouse moves off of this widget.
  • onMouseMove(event) Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
  • onMouseOut(event) Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
  • onMouseOver(event) Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
  • onMouseUp(event) Connect to this function to receive notifications of when the mouse button is released.
  • onSetStore() a function that can be connected to in order to receive a notification that the store has finished loading and all options from that store are available
  • onShow() Called when this widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.

Properties

_aroundNode
Defined by: dijit/_HasDropDown

The node to display the popup around. Can be set via a data-dojo-attach-point assignment. If missing, then domNode will be used.

_arrowWrapperNode
Defined by: dijit/_HasDropDown

Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending on where the drop down is set to be positioned. Can be set via a data-dojo-attach-point assignment. If missing, then _buttonNode will be used.

_attachEvents
Defined by: dijit/_AttachMixin

List of connections associated with data-dojo-attach-event=... in the template

_attachPoints
Defined by: dijit/_AttachMixin

List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]

_attrPairNames
Defined by: dijit/_WidgetBase
_blankGif
Defined by: dijit/_WidgetBase

Path to a blank 1x1 image. Used by <img> nodes in templates that really get their image via CSS background-image.

_buttonInputDisabled
Defined by: dijit/form/Select
_buttonNode
Defined by: dijit/_HasDropDown

The button/icon/node to click to display the drop down. Can be set via a data-dojo-attach-point assignment. If missing, then either focusNode or domNode (if focusNode is also missing) will be used.

_childrenLoaded
Defined by: dijit/form/Select

Whether or not our children have been loaded

_focusManager
Defined by: dijit/_FocusMixin
_isLoaded
Defined by: dijit/form/Select

Whether or not we have been loaded

_keyNavCodes
Defined by: dijit/_KeyNavMixin

Hash mapping key code (arrow keys and home/end key) to functions to handle those keys. Usually not used directly, as subclasses can instead override _onLeftArrow() etc.

_onChangeActive

Indicates that changes to the value should call onChange() callback. This is false during widget initialization, to avoid calling onChange() when the initial value is set.

_onContainerKeydown
Defined by: dijit/form/Select
_onContainerKeypress
Defined by: dijit/form/Select
_popupStateNode
Defined by: dijit/_HasDropDown

The node to set the aria-expanded class on. Also sets popupActive class but that will be removed in 2.0. Can be set via a data-dojo-attach-point assignment. If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.

_rendered
Defined by: dijit/_TemplatedMixin

Not normally use, but this flag can be set by the app if the server has already rendered the template, i.e. already inlining the template for the widget into the main page. Reduces _TemplatedMixin to just function like _AttachMixin.

_searchString
Defined by: dijit/_KeyNavMixin
_setClassAttr
Defined by: dijit/_WidgetBase
_setDirAttr
Defined by: dijit/_WidgetBase
_setIdAttr
Defined by: dijit/_WidgetBase
_setLangAttr
Defined by: dijit/_WidgetBase
_setNameAttr
Defined by: dijit/form/Select
_setTabIndexAttr
_setTypeAttr
Defined by: dijit/_WidgetBase
_skipNodeCache
Defined by: dijit/_TemplatedMixin
_started
Defined by: dijit/_WidgetBase

startup() has completed.

_stopClickEvents
Defined by: dijit/_HasDropDown

When set to false, the click events will not be stopped, in case you want to use them in your subclass

active
Defined by: dijit/_CssStateMixin

True if mouse was pressed while over this widget, and hasn't been released yet

alt

Corresponds to the native HTML <input> element's attribute.

aria-label
attachScope
Defined by: dijit/_AttachMixin

Object to which attach points and events will be scoped. Defaults to 'this'.

attributeMap
Defined by: dijit/_WidgetBase

Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute for each XXX attribute to be mapped to the DOM.

attributeMap sets up a "binding" between attributes (aka properties) of the widget and the widget's DOM. Changes to widget attributes listed in attributeMap will be reflected into the DOM.

For example, calling set('title', 'hello') on a TitlePane will automatically cause the TitlePane's DOM to update with the new title.

attributeMap is a hash where the key is an attribute of the widget, and the value reflects a binding to a:

  • DOM node attribute

    focus: {node: "focusNode", type: "attribute"} Maps this.focus to this.focusNode.focus

  • DOM node innerHTML

    title: { node: "titleNode", type: "innerHTML" } Maps this.title to this.titleNode.innerHTML

  • DOM node innerText

    title: { node: "titleNode", type: "innerText" } Maps this.title to this.titleNode.innerText

  • DOM node CSS class

    myClass: { node: "domNode", type: "class" } Maps this.myClass to this.domNode.className

If the value is an array, then each element in the array matches one of the formats of the above list.

There are also some shorthands for backwards compatibility:

  • string --> { node: string, type: "attribute" }, for example:
"focusNode" ---> { node: "focusNode", type: "attribute" }
  • "" --> { node: "domNode", type: "attribute" }
autoWidth
Defined by: dijit/_HasDropDown

Set to true to make the drop down at least as wide as this widget. Set to false if the drop down should just be its default width.

baseClass
Defined by: dijit/form/Select
class
Defined by: dijit/_WidgetBase
containerNode
Defined by: dijit/_WidgetBase

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 data-dojo-type=myWidget>
    <b> here's a plain DOM node
    <span data-dojo-type=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 data-dojo-type=subWidget>and a widget</span>
<i> and another plain DOM node </i>

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.

cssStateNodes
Defined by: dijit/_CssStateMixin

Subclasses may define a cssStateNodes property that lists sub-nodes within the widget that need CSS classes applied on mouse hover/press and focus.

Each entry in this optional hash is a an attach-point name (like "upArrowButton") mapped to a CSS class name (like "dijitUpArrowButton"). Example:

{
    "upArrowButton": "dijitUpArrowButton",
    "downArrowButton": "dijitDownArrowButton"
}

The above will set the CSS class dijitUpArrowButton to the this.upArrowButton DOMNode when it

is hovered, etc.

dir
Defined by: dijit/_WidgetBase

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.

disabled

Should this widget respond to user input? In markup, this is specified as "disabled='disabled'", or just "disabled".

domNode
Defined by: dijit/_WidgetBase

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.

dropDown
Defined by: dijit/_HasDropDown

The widget to display as a popup. This widget must be defined before the startup function is called.

dropDownPosition
Defined by: dijit/_HasDropDown

This variable controls the position of the drop down. It's an array of strings with the following values:

  • before: places drop down to the left of the target node/widget, or to the right in the case of RTL scripts like Hebrew and Arabic
  • after: places drop down to the right of the target node/widget, or to the left in the case of RTL scripts like Hebrew and Arabic
  • above: drop down goes above target node
  • below: drop down goes below target node

The list is positions is tried, in order, until a position is found where the drop down fits within the viewport.

emptyLabel
Defined by: dijit/form/Select

What to display in an "empty" dropdown

focused
Defined by: dijit/_FocusMixin

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

focusedChild
Defined by: dijit/_KeyNavMixin

The currently focused child widget, or null if there isn't one

forceWidth
Defined by: dijit/_HasDropDown

Set to true to make the drop down exactly as wide as this widget. Overrides autoWidth.

hovering
Defined by: dijit/_CssStateMixin

True if cursor is over this widget

id
Defined by: dijit/_WidgetBase

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.

intermediateChanges

Fires onChange for each value change or only on demand

labelAttr

The entries in the drop down list come from this attribute in the dojo.store items. If store is set, labelAttr must be set too, unless store is an old-style dojo.data store rather than a new dojo/store.

labelType
Defined by: dijit/form/Select

Specifies how to interpret the labelAttr in the data store items. Can be "html" or "text".

lang
Defined by: dijit/_WidgetBase

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).

loadChildrenOnOpen

By default loadChildren is called when the items are fetched from the store. This property allows delaying loadChildren (and the creation of the options/menuitems) until the user clicks the button to open the dropdown.

maxHeight
Defined by: dijit/_HasDropDown

The max height for our dropdown. Any dropdown taller than this will have scrollbars. Set to 0 for no max height, or -1 to limit height to available space in viewport

message
Defined by: dijit/form/Select

Currently displayed error/prompt message

multiCharSearchDuration
Defined by: dijit/_KeyNavMixin

If multiple characters are typed where each keystroke happens within multiCharSearchDuration of the previous keystroke, search for nodes matching all the keystrokes.

For example, typing "ab" will search for entries starting with "ab" unless the delay between "a" and "b" is greater than multiCharSearchDuration.

multiple

Whether or not we are multi-valued

name

Name used when submitting form; same as "name" attribute or plain HTML elements

onFetch

A callback to do with an onFetch - but before any items are actually iterated over (i.e. to filter even further what you want to add)

onLoadDeferred

This is the dojo.Deferred returned by setStore(). Calling onLoadDeferred.then() registers your callback to be called only once, when the prior setStore completes.

options

The set of options for our select item. Roughly corresponds to the html <option> tag.

ownerDocument
Defined by: dijit/_WidgetBase

The document this widget belongs to. If not specified to constructor, will default to srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global

query

A query to use when fetching items from our store

queryOptions

Query options to use when fetching from the store

readOnly

Should this widget respond to user input? In markup, this is specified as "readOnly". Similar to disabled except readOnly form values are submitted.

required
Defined by: dijit/form/Select

Can be true or false, default is false.

scrollOnFocus

On focus, should this widget scroll into view?

searchContainerNode
Defined by: dijit/_TemplatedMixin
sortByLabel

Flag to sort the options returned from a store by the label of the store.

srcNodeRef
Defined by: dijit/_WidgetBase

pointer to original DOM node

state
Defined by: dijit/form/Select

"Incomplete" if this select is required but unset (i.e. blank value), "" otherwise

store

A store to use for getting our list of options - rather than reading them from the <option> html tags. Should support getIdentity(). For back-compat store can also be a dojo/data/api/Identity.

style
Defined by: dijit/_WidgetBase

HTML style attributes as cssText string or name/value hash

tabIndex

Order fields are traversed when user hits the tab key

templatePath
Defined by: dijit/_TemplatedMixin

Path to template (HTML file) for this widget relative to dojo.baseUrl. Deprecated: use templateString with require([... "dojo/text!..."], ...) instead

templateString
Defined by: dijit/form/Select
title
Defined by: dijit/_WidgetBase

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. In this case it's interpreted as HTML.

tooltip
Defined by: dijit/_WidgetBase

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.

tooltipPosition
Defined by: dijit/form/Select

See description of dijit/Tooltip.defaultPosition for details on this parameter.

type

Corresponds to the native HTML <input> element's attribute.

value

Corresponds to the native HTML <input> element's attribute.

Methods

_addOptionForItem(item)

Creates (and adds) the option for the given item

Parameter Type Description
item item
_addOptionItem(option)
Defined by dijit/form/Select

For the given option, add an option to our dropdown. If the option doesn't have a value, then a separator is added in that place.

Parameter Type Description
option Object

An object with the following properties:

  • value (String):

    The value of the option. Setting to empty (or missing) will place a separator at that location

  • label (String):

    The label for our option. It can contain html tags.

  • selected (Boolean):

    Whether or not we are a selected option

  • disabled (Boolean):

    Whether or not this specific option is disabled

_applyAttributes()
Defined by dijit/_WidgetBase

Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.

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.

For backwards-compatibility reasons attributeMap overrides _setXXXAttr when _setXXXAttr is a hash/string/array, but _setXXXAttr as a functions override attributeMap.

_attach(node,type,func)
Defined by dijit/_AttachMixin

Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.

Parameter Type Description
node DOMNode

The node to setup a listener on.

type String

Event name like "click".

func undefined
Returns:undefined
_attachTemplateNodes(rootNode)
Defined by dijit/_AttachMixin

Iterate through the dom nodes and attach functions and nodes accordingly.

Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:

  • dojoAttachPoint/data-dojo-attach-point
  • dojoAttachEvent/data-dojo-attach-event
Parameter Type Description
rootNode DomNode

The node to search for properties. All descendants will be searched.

_attrToDom(attr,value,commands)
Defined by dijit/_WidgetBase

Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter. If commands isn't specified then it's looked up from attributeMap. Note some attributes like "type" cannot be processed this way as they are not mutable.

Parameter Type Description
attr String

Name of member variable (ex: "focusNode" maps to this.focusNode) pointing to DOMNode inside the widget, or alternately pointing to a subwidget

value String
commands Object
Optional
_beforeFillContent()
Defined by dijit/_AttachMixin
_changeAttrValue(name,value)
Defined by dojo/Stateful

Internal helper for directly changing an attribute value.

Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.

Parameter Type Description
name String

The property to set.

value Mixed

The value to set in the property.

Returns:function

Internal helper for directly changing an attribute value.

_cssMouseEvent(event)

Handler for CSS event on this.domNode. Sets hovering and active properties depending on mouse state, which triggers _setStateClass() to set appropriate CSS classes for this.domNode.

Parameter Type Description
event Event
_deprecatedSetStore(store,selectedValue,fetchArgs)

Sets the store you would like to use with this select widget. The selected value is the value of the new store to set. This function returns the original store, in case you want to reuse it or something.

Parameter Type Description
store dojo/store/api/Store

The dojo.store you would like to use - it MUST implement getIdentity() and MAY implement observe(). For backwards-compatibility this can also be a data.data store, in which case it MUST implement dojo/data/api/Identity, and MAY implement dojo/data/api/Notification.

selectedValue anything
Optional

The value that this widget should set itself to after the store has been loaded

fetchArgs Object
Optional

Hash of parameters to set filter on store, etc.

  • query: new value for Select.query,
  • queryOptions: new value for Select.queryOptions,
  • onFetch: callback function for each item in data (Deprecated)
Returns:undefined
_detachTemplateNodes()
Defined by dijit/_AttachMixin

Detach and clean up the attachments made in _attachtempalteNodes.

_escapeValue(val)

Escape a value to be inserted into the template, either into an attribute value (ex: foo="${bar}") or as inner text of an element (ex: ${foo})

Parameter Type Description
val String
Returns:undefined
_fillContent()
Defined by dijit/form/Select

Set the value to be the first, or the selected index

_get(name)
Defined by dijit/_WidgetBase

Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters. Used mainly by custom getters.

For example, CheckBox._getValueAttr() calls this._get("value").

Parameter Type Description
name String
Returns:undefined
_getAttrNames(name)
Defined by dijit/_WidgetBase

Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.

Parameter Type Description
name undefined
Returns:undefined | object
_getChildren()
Defined by dijit/form/Select
Returns:Array | undefined
_getDisplayedValueAttr()

returns the displayed value of the widget

Returns:undefined
_getFirst()
Defined by dijit/form/Select

Returns the first child widget.

Returns:null
_getFirstFocusableChild()
Defined by dijit/_KeyNavMixin

Returns first child that can be focused.

Returns:undefined
_getLast()
Defined by dijit/form/Select

Returns the last child widget.

Returns:null
_getLastFocusableChild()
Defined by dijit/_KeyNavMixin

Returns last child that can be focused.

Returns:undefined
_getMenuItemForOption(option)
Defined by dijit/form/Select

For the given option, return the menu item that should be used to display it. This can be overridden as needed

Parameter Type Description
option Object

An object with the following properties:

  • value (String):

    The value of the option. Setting to empty (or missing) will place a separator at that location

  • label (String):

    The label for our option. It can contain html tags.

  • selected (Boolean):

    Whether or not we are a selected option

  • disabled (Boolean):

    Whether or not this specific option is disabled

Returns:instance
_getNext(child,dir)
Defined by dijit/_KeyNavMixin

Returns the next descendant, compared to "child".

Parameter Type Description
child Widget

The current widget

dir Integer
  • 1 = after
  • -1 = before
Returns:undefined | null
_getNextFocusableChild(child,dir)
Defined by dijit/_KeyNavMixin

Returns the next or previous focusable descendant, compared to "child". Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.

Parameter Type Description
child Widget

The current widget

dir Integer
  • 1 = after
  • -1 = before
Returns:undefined | null
_getOptionObjForItem(item)

Returns an option object based off the given item. The "value" of the option item will be the identity of the item, the "label" of the option will be the label of the item.

Parameter Type Description
item undefined
Returns:object
_getSelectedOptionsAttr()

hooks into this.attr to provide a mechanism for getting the option items for the current value of the widget.

Returns:undefined
_getValueFromOpts()

Returns the value of the widget by reading the options for the selected flag

Returns:string
_handleOnChange(newValue,priorityChange)

Called when the value of the widget is set. Calls onChange() if appropriate

Parameter Type Description
newValue anything

the new value

priorityChange Boolean
Optional

For a slider, for example, dragging the slider is priorityChange==false, but on mouse up, it's priorityChange==true. If intermediateChanges==false, onChange is only called form priorityChange=true events.

_introspect()
Defined by dijit/_WidgetBase

Collect metadata about this widget (only once per class, not once per instance):

- list of attributes with custom setters, storing in this.constructor._setterAttrs
- generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
_keyboardSearch(evt,keyChar)
Defined by dijit/_KeyNavMixin

Perform a search of the widget's options based on the user's keyboard activity

Called on keypress (and sometimes keydown), searches through this widget's children looking for items that match the user's typed search string. Multiple characters typed within 1 sec of each other are combined for multicharacter searching.

Parameter Type Description
evt Event
keyChar String
_keyboardSearchCompare(item,searchString)
Defined by dijit/_KeyNavMixin

Compares the searchString to the widget's text label, returning:

* -1: a high priority match  and stop searching
* 0: not a match
* 1: a match but keep looking for a higher priority match
Parameter Type Description
item dijit/_WidgetBase
searchString String
Returns:number
_layoutHackIE7()

Work around table sizing bugs on IE7 by forcing redraw

_loadChildren(loadMenuItems)
Defined by dijit/form/Select

Resets the menu and the length attribute of the button - and ensures that the label is appropriately set.

Parameter Type Description
loadMenuItems Boolean

actually loads the child menu items - we only do this when we are populating for showing the dropdown.

_Menu()
Defined by dijit/form/Select
_processTemplateNode(baseNode,getAttrFunc,attachFunc)
Defined by dijit/_AttachMixin

Process data-dojo-attach-point and data-dojo-attach-event for given node or widget. Returns true if caller should process baseNode's children too.

Parameter Type Description
baseNode DOMNode | Widget
getAttrFunc Function

Function to get the specified property for a given DomNode/Widget.

attachFunc Function
Optional

Attaches an event handler from the specified node/widget to specified function.

Returns:boolean
_pseudoLoadChildren(items)

a function that will "fake" loading children, if needed, and if we have set to not load children until the widget opens.

Parameter Type Description
items item[]

An array of items that will be loaded, when needed

_refreshState()
Defined by dijit/form/Select
_removeOptionItem(option)

User-overridable function which, for the given option, removes its item from the select.

Parameter Type Description
option Object

An object with the following properties:

  • value (String):

    The value of the option. Setting to empty (or missing) will place a separator at that location

  • label (String):

    The label for our option. It can contain html tags.

  • selected (Boolean):

    Whether or not we are a selected option

  • disabled (Boolean):

    Whether or not this specific option is disabled

_set(name,value)
Defined by dijit/_WidgetBase

Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.

Parameter Type Description
name String
value anything
_setDisabledAttr(value)
Defined by dijit/form/Select
Parameter Type Description
value Boolean
_setDisplay(newDisplay)
Defined by dijit/form/Select
Parameter Type Description
newDisplay String
_setDisplayedValueAttr(label)

Sets the displayed value of the widget

Parameter Type Description
label undefined
_setFocusedAttr(val)
Defined by dijit/_Widget
Parameter Type Description
val undefined
_setOptionsAttr(options)
Defined by dijit/form/Select
Parameter Type Description
options Array
_setOwnerDocumentAttr(val)
Defined by dijit/_WidgetBase
Parameter Type Description
val undefined
_setQueryAttr(query)
Parameter Type Description
query undefined
_setQueryOptionsAttr(queryOptions)
Parameter Type Description
queryOptions undefined
_setReadOnlyAttr(value)
Parameter Type Description
value Boolean
_setRequiredAttr(value)
Defined by dijit/form/Select
Parameter Type Description
value Boolean
_setStateClass()

Update the visual state of the widget by setting the css classes on this.domNode (or this.stateNode if defined) by combining this.baseClass with various suffixes that represent the current widget state(s).

In the case where a widget has multiple states, it sets the class based on all possible combinations. For example, an invalid form widget that is being hovered will be "dijitInput dijitInputInvalid dijitInputHover dijitInputInvalidHover".

The widget may have one or more of the following states, determined by this.state, this.checked, this.valid, and this.selected:

  • Error - ValidationTextBox sets this.state to "Error" if the current input value is invalid
  • Incomplete - ValidationTextBox sets this.state to "Incomplete" if the current input value is not finished yet
  • Checked - ex: a checkmark or a ToggleButton in a checked state, will have this.checked==true
  • Selected - ex: currently selected tab will have this.selected==true

In addition, it may have one or more of the following states, based on this.disabled and flags set in _onMouse (this.active, this.hovering) and from focus manager (this.focused):

  • Disabled - if the widget is disabled
  • Active - if the mouse (or space/enter key?) is being pressed down
  • Focused - if the widget has focus
  • Hover - if the mouse is over the widget
_setStoreAttr(val)
Parameter Type Description
val undefined
_setStyleAttr(value)
Defined by dijit/form/Select
Parameter Type Description
value String | Object
_setValueAttr(value)
Defined by dijit/form/Select
Parameter Type Description
value undefined
_stringRepl(tmpl)

Does substitution of ${foo} type properties in template string

Parameter Type Description
tmpl undefined
Returns:undefined
_subnodeCssMouseEvent(node,clazz,evt)

Handler for hover/active mouse event on widget's subnode

Parameter Type Description
node undefined
clazz undefined
evt undefined
_trackMouseState(node,clazz)

Track mouse/focus events on specified node and set CSS class on that node to indicate current state. Usually not called directly, but via cssStateNodes attribute.

Given class=foo, will set the following CSS class on the node

  • fooActive: if the user is currently pressing down the mouse button while over the node
  • fooHover: if the user is hovering the mouse over the node, but not pressing down a button
  • fooFocus: if the node is focused

Note that it won't set any classes if the widget is disabled.

Parameter Type Description
node DomNode

Should be a sub-node of the widget, not the top node (this.domNode), since the top node is handled specially and automatically just by mixing in this class.

clazz String

CSS class name (ex: dijitSliderUpArrow)

_updateSelection()

Sets the "selected" class on the item for styling purposes

addOption(option)

Adds an option or options to the end of the select. If value of the option is empty or missing, a separator is created instead. Passing in an array of options will yield slightly better performance since the children are only loaded once.

Parameter Type Description
option __SelectOption | __SelectOption[]
attr(name,value)
Defined by dijit/_Widget

This method is deprecated, use get() or set() directly.

Parameter Type Description
name String | Object

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.

value Object
Optional

Optional. If provided, attr() operates as a setter. If omitted, the current value of the named property is returned.

Returns:undefined
buildRendering()
childSelector(node)
Defined by dijit/form/Select
Parameter Type Description
node DOMNode
Returns:undefined
closeDropDown(focus)
Defined by dijit/_HasDropDown

Closes the drop down on this widget

Parameter Type Description
focus Boolean

If true, refocuses the button widget

compare(val1,val2)

Compare 2 values (as returned by get('value') for this widget).

Parameter Type Description
val1 anything
val2 anything
Returns:number
connect(obj,event,method)
Defined by dijit/_WidgetBase

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.

Parameter Type Description
obj Object | null
event String | Function
method String | Function
Returns:any | undefined

A handle that can be passed to disconnect in order to disconnect before the widget is destroyed.

Examples

Example 1

var btn = new 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());
});
create(params,srcNodeRef)
Defined by dijit/_WidgetBase

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://dojotoolkit.org/reference-guide/dijit/_WidgetBase.html 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.

Parameter Type Description
params Object | null

Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties.

srcNodeRef DOMNode | String
Optional

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
defer(fcn,delay)
Defined by dijit/_WidgetBase

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).

Parameter Type Description
fcn Function

Function reference.

delay Number
Optional

Delay, defaults to 0.

Returns:object
destroy(preserveDom)
Defined by dijit/form/Select
Parameter Type Description
preserveDom undefined
destroyDescendants(preserveDom)
Defined by dijit/_WidgetBase

Recursively destroy the children of this widget and their descendants.

Parameter Type Description
preserveDom Boolean
Optional

If true, the preserveDom attribute is passed to all descendant widget's .destroy() method. Not for use with _Templated widgets.

destroyRecursive(preserveDom)
Defined by dijit/_WidgetBase

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.

Parameter Type Description
preserveDom Boolean
Optional

If true, this method will leave the original DOM structure alone of descendant Widgets. Note: This will NOT work with dijit._TemplatedMixin widgets.

destroyRendering(preserveDom)
Defined by dijit/_WidgetBase

Destroys the DOM nodes associated with this widget.

Parameter Type Description
preserveDom Boolean
Optional

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

disconnect(handle)
Defined by dijit/_WidgetBase

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

Disconnects handle created by connect.

Parameter Type Description
handle undefined
emit(type,eventObj,callbackArgs)
Defined by dijit/_WidgetBase

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).

Parameter Type Description
type String
eventObj Object
Optional
callbackArgs Array
Optional
Returns:undefined
focus()
Defined by dijit/form/Select
focusChild(widget)
Defined by dijit/form/Select

Sets the value to the given option, used during search by letter.

Parameter Type Description
widget dijit/_WidgetBase

Reference to option's widget

focusFirstChild()
Defined by dijit/_KeyNavMixin

Focus the first focusable child in the container.

focusLastChild()
Defined by dijit/_KeyNavMixin

Focus the last focusable child in the container.

get(name)
Defined by dijit/_WidgetBase

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 properties foo and bar and a method named _getFooAttr(), calling: myWidget.get("foo") would be equivalent to calling widget._getFooAttr() and myWidget.get("bar") would be equivalent to the expression widget.bar2

Parameter Type Description
name undefined

The property to get.

Returns:undefined
getChildren()
Defined by dijit/_WidgetBase

Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget. Note that it does not return all descendants, but rather just direct children. Analogous to Node.childNodes, except containing widgets rather than DOMNodes.

The result intentionally excludes internally created widgets (a.k.a. supporting widgets) outside of this.containerNode.

Note that the array returned is a simple array. Application code should not assume existence of methods like forEach().

Returns:Array
getDescendants()
Defined by dijit/_Widget

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.

Returns:Array
getOptions(valueOrIdx)

Returns a given option (or options).

Parameter Type Description
valueOrIdx anything

If passed in as a string, that string is used to look up the option in the array of options - based on the value property. (See dijit/form/_FormSelectWidget.__SelectOption).

If passed in a number, then the option with the given index (0-based) within this select will be returned.

If passed in a dijit/form/_FormSelectWidget.__SelectOption, the same option will be returned if and only if it exists within this select.

If passed an array, then an array will be returned with each element in the array being looked up.

If not passed a value, then all options will be returned

Returns:any | object | undefined | null

The option corresponding with the given value or index. null is returned if any of the following are true:

  • A string value is passed in which doesn't exist
  • An index is passed in which is outside the bounds of the array of options
  • A dijit/form/_FormSelectWidget.__SelectOption is passed in which is not a part of the select
getParent()
Defined by dijit/_WidgetBase

Returns the parent widget of this widget.

Returns:undefined
getValue()

Deprecated. Use get('value') instead.

Returns:undefined
isFocusable()
Defined by dijit/_WidgetBase

Return true if this widget can currently be focused and false if not

Returns:undefined
isLeftToRight()
Defined by dijit/_WidgetBase

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

Returns:undefined
isLoaded()
Defined by dijit/form/Select
Returns:undefined
isValid(isFocused)
Defined by dijit/form/Select

Whether or not this is a valid value. The only way a Select can be invalid is when it's required but nothing is selected.

Parameter Type Description
isFocused Boolean
Returns:boolean
loadAndOpenDropDown()
Defined by dijit/_HasDropDown

Creates the drop down if it doesn't exist, loads the data if there's an href and it hasn't been loaded yet, and then opens the drop down. This is basically a callback when the user presses the down arrow button to open the drop down.

Returns:Deferred | instance

Deferred for the drop down widget that fires when drop down is created and loaded

loadDropDown(loadCallback)
Defined by dijit/form/Select

populates the menu

Parameter Type Description
loadCallback Function
on(type,func)
Defined by dijit/_Widget
Parameter Type Description
type String | Function

protected

func Function
Returns:undefined
openDropDown()
Defined by dijit/_HasDropDown

Opens the dropdown for this widget. To be called only when this.dropDown has been created and is ready to display (ie, it's data is loaded).

Returns:any | undefined

return value of dijit/popup.open()

own()
Defined by dijit/Destroyable

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

Returns:any | undefined

The array of specified handles, so you can do for example:

var handle = this.own(on(...))[0];
placeAt(reference,position)
Defined by dijit/_WidgetBase

Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.

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.

Parameter Type Description
reference String | DomNode | DocumentFragment | dijit/_WidgetBase

Widget, DOMNode, DocumentFragment, or id of widget or DOMNode

position String | Int
Optional

If reference is a widget (or id of widget), and that widget has an ".addChild" method, it will be called passing this widget instance into that method, supplying the optional position index passed. In this case position (if specified) should be an integer.

If reference is a DOMNode (or id matching a DOMNode but not a widget), the position argument can be a numeric index or a string "first", "last", "before", or "after", same as dojo/dom-construct::place().

Returns:dijit/_WidgetBase | function

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.

Examples

Example 1

// create a Button with no srcNodeRef, and place it in the body:
var button = new Button({ label:"click" }).placeAt(win.body());
// now, 'button' is still the widget reference to the newly created button
button.on("click", function(e){ console.log('click'); }));

Example 2

// create a button out of a node with id="src" and append it to id="wrapper":
var button = new Button({},"src").placeAt("wrapper");

Example 3

// place a new button as the first element of some div
var button = new Button({ label:"click" }).placeAt("wrapper","first");

Example 4

// create a contentpane and add it to a TabContainer
var tc = dijit.byId("myTabs");
new ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
postCreate()
Defined by dijit/form/Select
postMixInProperties()
Defined by dijit/form/Select

set the missing message

postscript(params,srcNodeRef)
Defined by dijit/_WidgetBase

Kicks off widget instantiation. See create() for details.

Parameter Type Description
params Object
Optional
srcNodeRef DomNode | String
removeOption(valueOrIdx)

Removes the given option or options. You can remove by string (in which case the value is removed), number (in which case the index in the options array is removed), or select option (in which case, the select option with a matching value is removed). You can also pass in an array of those values for a slightly better performance since the children are only loaded once. For numeric option values, specify {value: number} as the argument.

Parameter Type Description
valueOrIdx String | __SelectOption | Number | Array
reset()
Defined by dijit/form/Select

Overridden so that the state will be cleared.

set(name,value)
Defined by dijit/_WidgetBase

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 properties foo and bar and a method named _setFooAttr(), calling myWidget.set("foo", "Howdy!") would be equivalent to calling widget._setFooAttr("Howdy!") and myWidget.set("bar", 3) would be equivalent to the statement 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)

Parameter Type Description
name undefined

The property to set.

value undefined

The value to set in the property.

Returns:function | string

Set a property on a widget

setAttribute(attr,value)
Defined by dijit/_Widget

Deprecated. Use set() instead.

Parameter Type Description
attr String
value anything
setDisabled(disabled)

Deprecated. Use set('disabled', ...) instead.

Parameter Type Description
disabled Boolean
setStore(store,selectedValue,fetchArgs)
Parameter Type Description
store undefined
selectedValue undefined
fetchArgs undefined
setValue(value)

Deprecated. Use set('value', ...) instead.

Parameter Type Description
value String
startup()
Defined by dijit/form/Select
subscribe(t,method)
Defined by dijit/_WidgetBase

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.

Parameter Type Description
t String

The topic

method Function

The callback

Returns:undefined

Examples

Example 1

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);
});
toggleDropDown()
Defined by dijit/_HasDropDown

Callback when the user presses the down arrow button or presses the down arrow key to open/close the drop down. Toggle the drop-down widget; if it is up, close it, if not, open it

toString()
Defined by dijit/_WidgetBase

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.

Returns:string
undo()

Restore the value to the last value passed to onChange

uninitialize()
Defined by dijit/_WidgetBase

Deprecated. Override destroy() instead to implement custom widget tear-down behavior.

Returns:boolean
unsubscribe(handle)
Defined by dijit/_WidgetBase

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

Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions

Parameter Type Description
handle Object
updateOption(newOption)

Updates the values of the given option. The option to update is matched based on the value of the entered option. Passing in an array of new options will yield better performance since the children will only be loaded once.

Parameter Type Description
newOption __SelectOption | __SelectOption[]
validate(isFocused)
Defined by dijit/form/Select

Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes

Show missing or invalid messages if appropriate, and highlight textbox field. Used when a select is initially set to no value and the user is required to set the value.

Parameter Type Description
isFocused Boolean
Returns:undefined
watch(name,callback)
Defined by dojo/Stateful

Watches a property for changes

Parameter Type Description
name String
Optional

Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched

callback Function

The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value.

Returns:any | object

An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:

var watchHandle = obj.watch("foo", callback);
watchHandle.unwatch(); // callback won't be called now

Events

_onBlur()
Defined by: dijit/form/Select

Examples

Example 1

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);
});
_onChildBlur(widget)
Defined by: dijit/_KeyNavMixin

Called when focus leaves a child widget to go to a sibling widget. Used to be used by MenuBase.js (remove for 2.0)

Parameter Type Description
widget dijit/_WidgetBase

Examples

Example 1

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);
});
_onChildFocus(child)
Defined by: dijit/_KeyNavMixin

Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.

It marks that the current node is the selected one, and the previously selected node no longer is.

Parameter Type Description
child dijit/_WidgetBase

Examples

Example 1

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);
});
_onContainerFocus(evt)
Defined by: dijit/_KeyNavMixin

Handler for when the container itself gets focus.

Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.

TODO for 2.0 (or earlier): Instead of having the container tabbable, always maintain a single child widget as tabbable, Requires code in startup(), addChild(), and removeChild(). That would avoid various issues like #17347.

Parameter Type Description
evt undefined

Examples

Example 1

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);
});
_onDeleteItem(item)
Parameter Type Description
item item

Examples

Example 1

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);
});
_onDownArrow()
Defined by: dijit/_KeyNavMixin

Called on down arrow key. Should go to the next child in vertical container widgets like Menu.

Examples

Example 1

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);
});
_onDropDownClick(e)
Defined by: dijit/_HasDropDown
Parameter Type Description
e Event

Examples

Example 1

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);
});
_onDropDownMouseDown(e)
Defined by: dijit/_HasDropDown

Callback when the user mousedown/touchstart on the arrow icon.

Parameter Type Description
e Event

Examples

Example 1

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);
});
_onDropDownMouseUp(e)
Defined by: dijit/_HasDropDown

Callback on mouseup/touchend after mousedown/touchstart on the arrow icon. Note that this function is called regardless of what node the event occurred on (but only after a mousedown/touchstart on the arrow).

If the drop down is a simple menu and the cursor is over the menu, we execute it, otherwise, we focus our drop down widget. If the event is missing, then we are not a mouseup event.

This is useful for the common mouse movement pattern with native browser <select> nodes:

  1. mouse down on the select node (probably on the arrow)
  2. move mouse to a menu item while holding down the mouse button
  3. mouse up. this selects the menu item as though the user had clicked it.
Parameter Type Description
e Event
Optional

Examples

Example 1

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);
});
_onFocus()
Defined by: dijit/form/Select

Examples

Example 1

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);
});
_onKey(e)
Defined by: dijit/_HasDropDown

Callback when the user presses a key while focused on the button node

Parameter Type Description
e Event

Examples

Example 1

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);
});
_onKeyUp()
Defined by: dijit/_HasDropDown

Examples

Example 1

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);
});
_onLeftArrow()
Defined by: dijit/_KeyNavMixin

Called on left arrow key, or right arrow key if widget is in RTL mode. Should go back to the previous child in horizontal container widgets like Toolbar.

Examples

Example 1

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);
});
_onMap(type)
Defined by: dijit/_WidgetBase

Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove"). If type is a synthetic event like touch.press then returns undefined.

Parameter Type Description
type String | Function
Returns:undefined

Examples

Example 1

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);
});
_onNewItem(item,parentInfo)
Parameter Type Description
item item
parentInfo Object
Optional

Examples

Example 1

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);
});
_onRightArrow()
Defined by: dijit/_KeyNavMixin

Called on right arrow key, or left arrow key if widget is in RTL mode. Should go to the next child in horizontal container widgets like Toolbar.

Examples

Example 1

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);
});
_onSetItem(item)
Parameter Type Description
item item

Examples

Example 1

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);
});
_onShow()
Defined by: dijit/_Widget

Internal method called when this widget is made visible. See onShow for details.

Examples

Example 1

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);
});
_onUpArrow()
Defined by: dijit/_KeyNavMixin

Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.

Examples

Example 1

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);
});
onBlur()
Defined by: dijit/_FocusMixin

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.

Examples

Example 1

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);
});
onChange(newValue)

Callback when this widget's value is changed.

Parameter Type Description
newValue undefined

Examples

Example 1

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);
});
onClick(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onClose()
Defined by: dijit/_Widget

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.

Returns:boolean

Examples

Example 1

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);
});
onDblClick(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onFocus()
Defined by: dijit/_FocusMixin

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

Examples

Example 1

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);
});
onHide()
Defined by: dijit/_Widget

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.

Examples

Example 1

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);
});
onKeyboardSearch(item,evt,searchString,numMatches)
Defined by: dijit/form/Select

When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.

Parameter Type Description
item dijit/_WidgetBase
evt Event
searchString String
numMatches Number

Examples

Example 1

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);
});
onKeyDown(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

key Event

Examples

Example 1

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);
});
onKeyPress(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

key Event

Examples

Example 1

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);
});
onKeyUp(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

key Event

Examples

Example 1

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);
});
onMouseDown(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onMouseEnter(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onMouseLeave(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onMouseMove(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onMouseOut(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onMouseOver(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onMouseUp(event)
Defined by: dijit/_Widget

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

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

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);
});
onSetStore()

a function that can be connected to in order to receive a notification that the store has finished loading and all options from that store are available

Examples

Example 1

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);
});
onShow()
Defined by: dijit/_Widget

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.

Examples

Example 1

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);
});
Error in the documentation? Can’t find what you are looking for? Let us know!