Mixin for widgets that need drop down ability.
See the dijit/_HasDropDown reference documentation for more information.
The node to display the popup around. Can be set via a data-dojo-attach-point assignment. If missing, then domNode will be used.
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.
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.
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.
When set to false, the click events will not be stopped, in case you want to use them in your subclass
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.
The widget to display as a popup. This widget must be defined before the startup function is called.
This variable controls the position of the drop down. It's an array of strings with the following values:
The list is positions is tried, in order, until a position is found where the drop down fits within the viewport.
Set to true to make the drop down exactly as wide as this widget. Overrides autoWidth.
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
Closes the drop down on this widget
Parameter | Type | Description |
---|---|---|
focus | Boolean | If true, refocuses the button widget |
Returns true if the dropdown exists and it's data is loaded. This can be overridden in order to force a call to loadDropDown().
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.
Deferred for the drop down widget that fires when drop down is created and loaded
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 calls the given callback.
Parameter | Type | Description |
---|---|---|
loadCallback | Function |
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).
return value of dijit/popup.open()
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
Called magically when focus has shifted away from this widget and it's dropdown
Callback when the user mousedown/touchstart on the arrow icon.
Parameter | Type | Description |
---|---|---|
e | Event |
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:
Parameter | Type | Description |
---|---|---|
e | Event |
Optional
|
Callback when the user presses a key while focused on the button node
Parameter | Type | Description |
---|---|---|
e | Event |