Dojo FAQ: Does Dijit have a confirm dialog?

By on May 8, 2013 10:01 am

No, Dijit does not provide pre-configured dialogs, like alert, confirm, or prompt.

Why? As simple as these may seem on the surface, each organization or application often needs something subtly different in terms of layout, appearance, behavior, events, and internationalization. Dojo and Dijit provide all the elements you need to make a variety of dialogs, including dijit/Dialog, dijit/form/Button, dojo/on, dojo/Deferred and dojo/i18n.

The time spent creating a dialog that suits your needs perfectly will be small compared to the overall time spent developing an application, and you will have a reusable module tailored to your specific needs that you can use throughout your application, or even across applications throughout your organization. Creating a custom dialog also ensures that teams of developers don’t have to struggle to get a generic confirmation dialog to respond and look like other dialogs in the application.

That being said, Dojo is an open-source, community-driven project, and you are encouraged to share general-purpose components with the community:

Comments

  • Simon Speich

    A while back I created a confirm dialog which imitates the blocking behavior of plain vanilla javascript by using a deferred. You can read about the confirm dialog widget on my website where you will also find a demo and the link to github.

  • At least you can share the way you do it to give a basic knowledge for new comer/beginner, so we don’t have to do unnecessary wheel invention.
    Base on that, people can improve the code by their needs.
    Especially because Dojo has its own way of programming, which people should aware of.

    How hard is it to give an example like this?
    http://stackoverflow.com/a/10405938

    Btw, really, someone needs to consider to bolt this into the core.
    ExtJs (for instance) gives the basic dialogs out of the box, while user can improve it further on.
    This is a common feature. Why is it being ignored?

  • Mangala SSS Khalsa

    As of release 1.10, Dojo’s Dijit library includes a confirm dialog:
    http://dojotoolkit.org/reference-guide/1.10/dijit/ConfirmDialog.html
    and a tooltip dialog version:
    http://dojotoolkit.org/reference-guide/1.10/dijit/ConfirmTooltipDialog.html