Login Register Help
API Documentation
Choose a stylesheet:

Constructordijit.Dialog

dojo.require("dijit.Dialog");

Pops up a modal dialog window, blocking access to the screen and also graying out the screen Dialog is extended from ContentPane so it supports all the same parameters (href, etc.)

Usage

var foo=new dijit.Dialog();

Examples

Example 1

<div dojoType="dijit.Dialog" href="test.html"></div>

Example 2

var foo = new dijit.Dialog({ title: "test dialog", content: "test content" };
dojo.body().appendChild(foo.domNode);
foo.startup();

Jump to PropertiesFunctionsBack to top

Functionattr(name: String|Object, value: Object?)
Defined by dijit._Widget
Set or get properties on a widget instance.
Construct the UI for this widget from a template, setting this.domNode.
Cancels an in-flight download of content
Functionconnect(obj: Object|null, event: String|Function, method: String|Function): _Widget.Handle
Defined by dijit._Widget
Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy.
Connects to the onChange function of all children to track valid state changes. 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.
Functioncreate(params: Object?, srcNodeRef: DomNode|String?)
Defined by dijit._Widget
Kick off the life-cycle of a widget
Functiondestroy(preserveDom: Boolean)
Destroy this widget, but not its descendants. This method will, however, destroy internal widgets such as those used within a template.
Destroy all the widgets inside the ContentPane and empty containerNode
Destroy the ContentPane and its contents
FunctiondestroyRendering(preserveDom: Boolean?)
Destroys the DOM nodes associated with this widget
Functiondisconnect(handles: Object)
Defined by dijit._Widget
Disconnects handle created by connect. Also removes handle from this widget's list of connects.
Functionexecute(formContents: Object)
Defined by dijit._DialogMixin
Callback when the user hits the submit button. Override this method to handle Dialog execution.
FunctiongetChildren(): dijit._Widget[]
Defined by dijit._Widget
Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. Does not return nested widgets, nor widgets that are part of this widget's template.
FunctiongetDescendants(): Array | dijit._Widget[]
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.
Hide the dialog
Defined by dijit._Widget
Return true if this widget can currently be focused and false if not
Defined by dijit._Widget
Checks the page for text direction
Returns true if all of the widgets are valid
Position the Dialog and the underlay
Defined by dijit._Widget
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.
Defined by dijit._DialogMixin
Called when user has pressed the Dialog's cancel button, to notify container.
FunctiononClick(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of mouse click events.
Defined by dijit._Widget
Callback if someone tries to close the child, child will be closed if func returns true
Called on DOM faults, require faults etc. in content. In order to display an error message in the pane, return the error message from this method, as an HTML string. By default (if this method is not overriden), it returns nothing, so the error message is just printed to the console.
FunctiononDblClick(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of mouse double click events.
Called when download is finished.
Called when download error occurs. In order to display an error message in the pane, return the error message from this method, as an HTML string. Default behavior (if this method is not overriden) is to display the error message inside the pane.
Called before download starts.
Defined by dijit._DialogMixin
Called when user has pressed the dialog's OK button, to notify container.
Defined by dijit._Widget
Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
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.
FunctiononKeyDown(event: key)
Defined by dijit._Widget
Connect to this function to receive notifications of keys being pressed down.
FunctiononKeyPress(event: key)
Defined by dijit._Widget
Connect to this function to receive notifications of printable keys being typed.
FunctiononKeyUp(event: key)
Defined by dijit._Widget
Connect to this function to receive notifications of keys being released.
FunctiononLoad(data)
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 overriden.
FunctiononMouseDown(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse button is pressed down.
FunctiononMouseEnter(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves onto this widget.
FunctiononMouseLeave(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves off of this widget.
FunctiononMouseMove(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
FunctiononMouseOut(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
FunctiononMouseOver(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
FunctiononMouseUp(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse button is released.
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.
Event hook, is called before old content is cleared
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.
FunctionplaceAt(reference: String|DomNode|_Widget, position: String|Integer?)
Defined by dijit._Widget
Place this widget's domNode reference somewhere in the DOM based on standard dojo.place conventions, or passing a Widget reference that contains and addChild member.
Called after a widget's dom has been setup
Called after the parameters to the widget have been read-in, but before the widget template is instantiated. Especially useful to set properties that are referenced in the widget template.
[Re]download contents of href and display
Functionresize(size)
See dijit.layout._LayoutWidget.resize for description. Although ContentPane doesn't extend _LayoutWidget, it does implement the same API.
FunctionsetAttribute(attr: String, value: anything)
Defined by dijit._Widget
Deprecated. Use attr() instead.
FunctionsetContent(data: String|DomNode|Nodelist)
Deprecated. Use attr('content', ...) instead.
FunctionsetHref(href: String|Uri)
Deprecated. Use attr('href', ...) instead.
Display the dialog
See dijit.layout._LayoutWidget.startup for description. Although ContentPane doesn't extend _LayoutWidget, it does implement the same API.
Functionsubscribe(topic: String, method: String|Function)
Defined by dijit._Widget
Subscribes to the specified topic and calls the specified method of this object and registers for unsubscribe() on widget destroy.
Defined by dijit._Widget
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 reversable serialization.
Stub function. Override to implement custom widget tear-down behavior.
Defined by dijit._Widget
Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions
returns if the form is valid - same as isValid - but provides a few additional (ui-specific) features. 1 - it will highlight any sub-widgets that are not valid 2 - it will call focus() on the first invalid sub-widget
Defined by dijit._Widget
Step during widget creation to copy all widget attributes to the DOM as per attributeMap and _setXXXAttr functions.
Function_attachTemplateNodes(rootNode: DomNode|Array[Widgets], getAttrFunc: Function?)
Defined by dijit._Templated
Iterate through the template and attach functions and nodes accordingly.
Function_attrToDom(attr: String, value: String)
Defined by dijit._Widget
Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified in attributeMap.
Function_checkIfSingleChild(): or a regexp for hidden elements like script | area | map | etc..
Test if we have exactly one visible widget as a child, and if so assume that we are a container for that widget, and should propogate startup() and resize() calls to it. Skips over things like data stores since they aren't visible.
Called after dragging the Dialog. Calculates the relative offset of the Dialog in relation to the viewport.
Defined by dijit._Templated
Relocate source contents to templated container node. this.containerNode must be able to receive children, or exceptions will be thrown.
Defined by dijit._Widget
Helper function for Widget.attr(). Caches attribute name values so we don't do the string ops every time.
Hook to make attr("content") work
Function_getFocusItems(dialogNode: Node)
Defined by dijit._DialogMixin
Find focusable Items each time a dialog is opened, setting _firstFocusItem and _lastFocusItem
Returns Object representing form values.
Function_isShown(): for TitlePane, etc.
Returns true if the content is currently shown.
Since I am a Container widget, each of my children expects me to call resize() or layout() on them.
Load/reload the href specified in this.href
Call this to load href contents if necessary.
Defined by dijit._Widget
This is where widgets do processing for when they stop being active, such as changing CSS classes. See onBlur() for more details.
Called when user hovers over close icon
Called when user stops hovering over close icon
Defined by dijit._Widget
Called when someone connects to one of my handlers. "Turn on" that handler if it isn't active yet. This is also called for every single initialization parameter so need to do nothing for parameters like "id".
Function_onError(type, err, consoleText)
Defined by dijit._Widget
This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.
Function_onKey(evt: Event): just let it go
Handles the keyboard events for accessibility reasons
This is called whenever new content is being loaded
Called when the ContentPane is made visible
Defined by dijit._DialogMixin
Callback when user hits submit button type: protected
This is called whenever the content is being unloaded
Position modal dialog in the viewport. If no relative offset in the viewport has been determined (by dragging, for instance), center the node. Otherwise, use the Dialog's stored relative offset, and position the node to top: left: values based on the viewport.
Call resize() on each of my child layout widgets, either now (if I'm currently visible) or when I become visible
Defined by dijit._Widget
Custom setter for the CSS "class" attribute
Function_setContent(cont, isFakeContent)
Insert the content into the container node
Hook to make attr("content", ...) work. Replaces old content with data content, include style classes from old content
Hook so attr("href", ...) works.
Defined by dijit._Widget
Sets the style attribut of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string
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 attr('value'))
Make sure the dialog is small enough to fit in viewport.
Defined by dijit._Templated
Does substitution of ${foo} type properties in template string
Connected to a widget's onChange function - update our valid state, if needed.

Jump to FunctionsPropertiesBack to top

Defined by dijit._DialogBase
Allows the user to add an aria-describedby attribute onto the dialog. The value should be the id of the container element of text that describes the dialog purpose (usually the first text in the dialog). <div dojoType="dijit.Dialog" aria-describedby="intro" .....> <div id="intro">Introductory text</div> <div>rest of dialog contents</div> </div>
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
Defined by dijit._Widget
HTML class attribute
Defined by dijit._Widget
True if user can close (destroy) this child, such as (for example) clicking the X on the tab.
Defined by dijit._Widget
The number of columns this widget should span.
Defined by dijit._Widget
Column of the grid to place the widget.
Designates where children of the source dom node will be placed. "Children" in this case refers to both dom nodes and widgets. For example, for myWidget: <div dojoType=myWidget> <b> here's a plain dom node <span dojoType=subWidget>and a widget</span> <i> and another plain dom node </i> </div> containerNode would point to: <b> here's a plain dom node <span dojoType=subWidget>and a widget</span> <i> and another plain dom node </i> In templated widgets, "containerNode" is set via a dojoAttachPoint assignment. containerNode must be defined for any widget that accepts innerHTML (like ContentPane or BorderContainer or even Button), and conversely is null for widgets that don't, like TextBox.
|| DomNode || NodeList || dijit._Widget The innerHTML of the ContentPane. Note that the initialization parameter / argument to attr("content", ...) can be a String, DomNode, Nodelist, or _Widget.
The time in milliseconds it takes the dialog to fade in and out
Defined by dijit._Widget
Unsupported by Dijit, but here for completeness. Dijit only supports setting text direction on the entire document. Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir) attribute. Either left-to-right "ltr" or right-to-left "rtl".
Don't change this parameter from the default value. This ContentPane parameter doesn't make sense for Dialog, since Dialog is never a child of a layout container, nor can you specify the size of Dialog in order to control the size of an inner widget.
This is our visible representation of the widget! Other DOM Nodes may by assigned to other properties, usually through the template system's dojoAttachPoint syntax, but the domNode property is the canonical "top level" node in widget UI.
Toggles the moveable aspect of the Dialog. If true, Dialog can be dragged by it's title. If false it will remain centered in the viewport.
Defined by dijit._Widget
To remove the drag capability.
Message that shows if an error occurs
Extract visible content from inside of <body> .... </body>. I.e., strip <html> and <head> (and it's contents) from the href
Defined by dijit._Widget
Defines a group belonging.
The href of the content that displays now. Set this at construction if you want to load data externally when the pane is shown. (Set preload=true to load it immediately.) Changing href after creation doesn't have any effect; use attr('href', ...);
Defined by dijit._Widget
CSS Class specifying icon to use in tab label etc. associated with this pane.
Defined by dijit._Widget
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.
Parameters to pass to xhrGet() request, for example: <div dojoType="dijit.layout.ContentPane" href="./bar" ioArgs="{timeout: 500}">
Indicates that this widget acts as a "parent" to the descendant widgets. This is here so child.getParent() finds me. See also isLayoutContainer.
Indicates that this widget is going to call resize() on it's children widgets.
True if the ContentPane has data in it, either specified during initialization (via href or inline content), or set via attr('content', ...) / attr('href', ...) False if it doesn't have any content, or if ContentPane is still in the process of downloading href.
Defined by dijit._Widget
The label to display for a given widget
Defined by dijit._Widget
Rarely used. Overrides the default Dojo locale used to render this widget, as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute. Value must be among the list of locales specified during by the Dojo bootstrap, formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
Defined by dijit._Widget
"none", "left", "right", "bottom", "top", and "client". See the LayoutContainer description for details on this parameter.
Message that shows while downloading
Defined by dijit._Widget
Specifies a minimum size (in pixels) for this widget when resized by a splitter
Defined by dijit._Widget
List of nodes that correctly handle click events via native browser support, and don't need dijit's help
This is the dojo.Deferred returned by attr('href', ...) and refresh(). Calling onLoadDeferred.addCallback() or addErrback() registers your callback to be called only once, when the prior attr('href', ...) call or the initial href parameter to the constructor finishes loading. This is different than an onLoad() handler which gets called any time any href is loaded.
True if Dialog is currently displayed on screen.
Parse content and create the widgets, if any.
Force load of data on initialization even if pane is hidden.
Prevent caching of data from href's by appending a timestamp to the href.
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
Refresh (re-download) content when pane goes from hidden to shown
Defined by dijit._Widget
"top", "bottom", "leading", "trailing", "left", "right", "center". See the BorderContainer description for details on this parameter.
Defined by dijit._Widget
Is this child currently selected? Can be specified at initialization time, but then to change selected child use dijit.layout.StackContainer.selectChild
Defined by dijit._Widget
Display title of pane as label in TabContainer/AccordionContainer, rather than just using icon specified in iconClass
Defined by dijit._Widget
Minimum size (width or height) of a child of a SplitContainer. The value is relative to other children's sizeShare properties.
Defined by dijit._Widget
Size (width or height) of a child of a SplitContainer. The value is relative to other children's sizeShare properties. For example, if there are two children and each has sizeShare=10, then each takes up 50% of the available space.
Defined by dijit._Widget
A parameter needed by RadioGroupSlide only. An optional paramter to force the ContentPane to slide in from a set direction. Defaults to "random", or specify one of "top", "left", "right", "bottom" to slideFrom top, left, right, or bottom.
Defined by dijit._Widget
Setting spanLabel to true makes the widget take up both the label and value cells. Defaults to false.
Defined by dijit._Widget
If true, puts a draggable splitter on this widget to resize when used inside a border container edge region.
Defined by dijit._Widget
pointer to original dom node
Defined by dijit._Widget
HTML style attributes as cssText string or name/value hash
Overrides dijit._Templated
Path to template (HTML file) for this widget relative to dojo.baseUrl. Deprecated: use templateString with dojo.cache() instead.
A string that represents the widget template. Pre-empts the templatePath. In builds that have their strings "interned", the templatePath is converted to an inline templateString, thereby preventing a synchronous network call. Use in conjunction with dojo.cache() to load from a file.
Defined by dijit._Widget
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, AccorionContainer, etc., it's used to specify the tab label, accordion pane title, etc.
Defined by dijit._Widget
a css size value (e.g. "100px")
Defined by dijit._Widget
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.
Defined by dijit._Templated
Should we parse the template to find widgets that might be declared in markup inside it? False by default.
Defined by dijit._Widget
Path to a blank 1x1 image. Used by <img> nodes in templates that really get their image via CSS background-image.
Defined by dijit._Templated
A fallback to preserve the 1.0 - 1.3 behavior of children in templates having their startup called before the parent widget fires postCreate. Defaults to 'false', causing child widgets to have their .startup() called immediately before a parent widget .startup(), but always after the parent .postCreate(). Set to 'true' to re-enable to previous, arguably broken, behavior.
DomNode The pointer to the first focusable node in the dialog. Set by dijit._DialogMixin._getFocusItems.
Does this Dialog attempt to restore the width and height after becoming too small?
DomNode The pointer to which node has focus prior to our dialog. Set by dijit._DialogMixin._getFocusItems.
Defined by dijit._Widget
startup() has completed.