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. |
List of connections associated with data-dojo-attach-event=... in the template
List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
The pointer to the first focusable node in the dialog. Set by dijit/_DialogMixin._getFocusItems().
The pointer to which node has focus prior to our dialog. Set by dijit/_DialogMixin._getFocusItems().
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.
HTML snippet to show the action bar (gray bar with OK/cancel buttons). Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
True if mouse was pressed while over this widget, and hasn't been released yet
Object to which attach points and events will be scoped. Defaults to 'this'.
A Toggle to modify the default focus behavior of a Dialog, which is to focus on the first dialog element after opening the dialog. False will disable autofocusing. Default: true
Dialog show [x] icon to close itself, and ESC key will close the dialog.
Toggles the movable aspect of the Dialog. If true, Dialog can be dragged by it's title. If false it will remain centered in the viewport.
Maximum size to allow the dialog to expand to, relative to viewport size
A Toggle to modify the default focus behavior of a Dialog, which is to re-focus the element which had focus before being opened. False will disable refocusing. Default: true
Will be "Error" if one or more of the child widgets has an invalid value, "Incomplete" if not all of the required child widgets are filled in. Otherwise, "", which indicates that the form is ready to be submitted.
Path to template (HTML file) for this widget relative to dojo.baseUrl. Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
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 |
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:
Parameter | Type | Description |
---|---|---|
rootNode | DomNode | The node to search for properties. All descendants will be searched. |
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 |
Detach and clean up the attachments made in _attachtempalteNodes.
Called after dragging the Dialog. Saves the position of the dialog in the viewport, and also adjust position to be fully within the viewport, so user doesn't lose access to handle
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 |
Relocate source contents to templated container node. this.containerNode must be able to receive children, or exceptions will be thrown.
Parameter | Type | Description |
---|---|---|
source | DomNode |
Returns all form widget descendants, searching through non-form child widgets like BorderContainer
Parameter | Type | Description |
---|---|---|
children | dijit/_WidgetBase[] |
Optional
|
Finds focusable items in dialog, and sets this._firstFocusItem and this._lastFocusItem
Compute what this.state should be based on state of children
Returns Object representing form values. See description of value
for details.
Position the dialog in the viewport. If no relative offset in the viewport has been determined (by dragging, for instance), center the dialog. Otherwise, use the Dialog's stored relative offset, adjusted by the viewport's scroll.
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. |
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:
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):
Stuff we need to do before showing the Dialog for the first time (but we defer it until right beforehand, for performance reasons).
Fill in form values from according to an Object (in the format returned by get('value'))
Parameter | Type | Description |
---|---|---|
obj | Object |
Does substitution of ${foo} type properties in template string
Parameter | Type | Description |
---|---|---|
tmpl | undefined |
Handler for hover/active mouse event on widget's subnode
Parameter | Type | Description |
---|---|---|
node | undefined | |
clazz | undefined | |
evt | undefined |
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
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) |
Construct the UI for this widget from a template, setting this.domNode.
You can call this function directly, ex. in the event that you programmatically add a widget to the form after the form has been initialized.
Parameter | Type | Description |
---|---|---|
inStartup | Boolean |
Deprecated method. Applications no longer need to call this. Remove for 2.0.
Callback when the user hits the submit button. Override this method to handle Dialog execution.
After the user has pressed the submit button, the Dialog first calls onExecute() to notify the container to hide the dialog and restore focus to wherever it used to be.
Then this method is called.
Parameter | Type | Description |
---|---|---|
formContents | Object |
Hide the dialog
Promise object that resolves when the display animation is complete
Returns true if all of the widgets are valid. Deprecated, will be removed in 2.0. Use get("state") instead.
Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as necessary to keep it visible.
Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the size of the dialog.
Parameter | Type | Description |
---|---|---|
dim | Object |
Optional Optional dimension object like {w: 200, h: 300} |
Display the dialog
Promise object that resolves when the display animation is complete
returns if the form is valid - same as isValid - but provides a few additional (ui-specific) features:
Called when child's value or disabled state changes
Parameter | Type | Description |
---|---|---|
attr | String |
Handles the keyboard events for accessibility reasons
Parameter | Type | Description |
---|---|---|
evt | Event |
Called when user has pressed the Dialog's cancel button, to notify container.
Developer shouldn't override or connect to this method; it's a private communication device between the TooltipDialog and the thing that opened it (ex: dijit/form/DropDownButton)
Called when user has pressed the dialog's OK button, to notify container.
Developer shouldn't override or connect to this method; it's a private communication device between the TooltipDialog and the thing that opened it (ex: dijit/form/DropDownButton)
Called when data has been loaded from an href.
Unlike most other callbacks, this function can be connected to (via dojo.connect
)
but should not be overridden.
Stub function to connect to if you want to do something (like disable/enable a submit button) when the valid state changes on the form as a whole.
Deprecated. Will be removed in 2.0. Use watch("state", ...) instead.
Parameter | Type | Description |
---|---|---|
isValid | Boolean |