Constructordijit.Dialog

dojo.require("dijit.Dialog");
defined in dijit/Dialog.js

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

function ()
parametertypedescription
paramsObjectOptional.
srcNodeRefDomNode|String 

Examples

Example 1


Example 2


test content

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

Jump to PropertiesFunctionsBack to top

Construct the UI for this widget from a template, setting this.domNode.
Cancels a inflight download of content
Functionconnect(obj: Object, event: String, method: String|Function)
Defined by dijit._Widget
Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy. Special event: "ondijitclick" triggers on a click or enter-down or space-up Similar to dojo.connect() but takes three arguments rather than four.
Functioncreate(params: Object?, srcNodeRef: DomNode|String)
Defined by dijit._Widget
Kick off the life-cycle of a widget
Functiondestroy(finalize: Boolean)
Destroy this widget, but not its descendants
Defined by dijit._Widget
Recursively destroy the children of this widget and their descendants.
Defined by dijit._Widget
Destroy this widget and it's 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's removed from the manager object.
Defined by dijit._Widget
Destroys the DOM nodes associated with this widget
Functiondisconnect(handles: Object)
Defined by dijit._Widget
Disconnects handle created by this.connect. Also removes handle from this widget's list of connects
Functionexecute(formContents: Object)
Defined by dijit._DialogMixin
User defined function to do stuff when the user hits the submit button
Defined by dijit._Widget
Returns all the widgets that contained by this, i.e., all widgets underneath this.containerNode.
generate JSON structure from form values
Functionhide()
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 DOM to for the text direction for bi-directional support
make sure that every widget that has a validator function returns true
position the Dialog and the underlay
Defined by dijit._Widget
stub function. Override or connect to this method to receive notifications for when the widget moves out of focus.
Defined by dijit._DialogMixin
Callback when user has canceled dialog, to notify container (user shouldn't override)
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 fault etc in content default is to display errormessage inside pane
called when download is finished
Called when download error occurs, default is to display errormessage inside pane. Overide function to change that. The string returned by this function will be the html that tells the user a error happend
called before download starts the string returned by this function will be the html that tells the user we are loading something override with your own function if you want to change text
Defined by dijit._DialogMixin
Callback when user is about to execute dialog, to notify container (user shouldn't override)
Defined by dijit._Widget
stub function. Override or connect to this method to receive notifications for when the widget moves into focus.
FunctiononLoad(e)
when href is specified we need to reposition the dialog after the data is loaded
Event hook, is called before old content is cleared
Called after a widget's dom has been setup
Defined by dijit._Widget
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.
Functionpostscript(params: Object?, srcNodeRef: DomNode|String)
Defined by dijit._Widget
Force a refresh (re-download) of content, be sure to turn off cache
FunctionsetAttribute(attr: String, value)
Defined by dijit._Widget
Set native HTML attributes reflected in the widget, such as readOnly, disabled, and maxLength in TextBox widgets.
Replaces old content with data content, include style classes from old content
FunctionsetHref(href: String)
Reset the (external defined) content of this pane and replace with new url Note: It delays the download until widget is shown if preload is false
fill in form values from a JSON structure
Functionshow()
display the dialog
Called after a widget's children, and other widgets on the page, have been created. Provides an opportunity to manipulate any children before they are displayed. This is useful for composite widgets that need to control or layout sub-widgets. Many layout widgets can use this as a wiring phase.
Defined by dijit._Widget
Overrides dijit._Widget
stub function. Override to implement custom widget tear-down behavior.
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
Function_attachTemplateNodes(rootNode: DomNode, getAttrFunc: Function?)
Defined by dijit._Templated
Iterate through the template and attach functions and nodes accordingly.
Test if we have exactly one 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.
scan my contents and create subwidgets
Defined by dijit._Templated
relocate source contents to templated container node this.containerNode must be able to receive children, or exceptions will be thrown
Function_getFocusItems(dialogNode: Node)
Defined by dijit._DialogMixin
returns true if the content is currently shown
Defined by dijit._Widget
Function_onError(type, err, consoleText)
Defined by dijit._Widget
Function_onKey(evt)
handles the keyboard events for accessibility reasons
Defined by dijit._DialogMixin
callback when user hits submit button
position modal dialog in center of screen
stuff we need to do before showing the Dialog for the first time (but we defer it until right beforehand, for performance reasons)
Defined by dijit._Templated

Jump to FunctionsPropertiesBack to top

A map of attributes and attachpoints -- typically standard HTML attributes -- to set on the widget's dom, at the "domNode" attach point, by default. Other node references can be specified as properties of 'this'
Class name to apply to ContentPane dom nodes TODO: this should be called "baseClass" like in the other widgets
holds child elements. "containerNode" is generally set via a dojoAttachPoint assignment and it designates where children of the src dom node will be placed
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 dojoAttachPonit syntax, but the domNode property is the canonical "top level" node in widget UI.
The time in milliseconds it takes the dialog to fade in and out
Message that shows if an error occurs
Extract visible content from inside of <body> .... </body>
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; see setHref();
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.
Tells loading status see onLoad|onUnload for event hooks
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).
Message that shows while downloading
is True or False depending on state of dialog
parse content and create the widgets, if any
Force load of data even if pane is hidden.
Cache content retreived externally
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
pointer to original dom node
Defined by dijit._Widget
HTML style attribute
Defined by dijit._Templated
a node that represents the widget template. Pre-empts both templateString and templatePath.
Overrides dijit._Templated
Path to template (HTML file) for this widget relative to dojo.baseUrl
Overrides dijit._Templated
a string that represents the widget template. Pre-empts the
Defined by dijit._Widget
Defined by dijit._Templated
should we parse the template to find widgets that might be declared in markup inside it? false by default.
The pointer to the first focusable node in the dialog
The pointer to which node has focus prior to our dialog
Defined by dijit._Widget