Demos
Documentation
API
More Samples
Download Wijmo

Dialogs

Dialogs are Popup controls without owner elements. They allow users to enter or edit information without switching to a new page or view. They can be modal or modeless, and are usually centered on the screen.

Dialogs are displayed using the show method, which has optional arguments to define whether the dialog should be modal or modeless, and a callback function invoked when the dialog is closed.

Dialogs are dismissed when the user presses the Escape key or when the dialog loses focus. They are also dismissed when the user clicks an element with a class that starts with "wj-hide" (e.g. "wj-hide", "wj-hide-ok", or "wj-hide-cancel"). In the latter case, the class name is assigned to the dialog's dialogResult property, and can be used by the callback function or by the hidden event handler to decide how to process the dialog's content.

This demo demonstrates this by defining three dialogs that simulate a user authorization UI. Notice how the dialogs provide HTML5-style validation and the ability to invoke a dialog from another (you can invoke the create account dialog from within the log-in dialog):