Set the options of dialogue jQuery UI in total

You can set the options in a dialog() jQuery UI in a comprehensive manner, so that they affect all dialogues that will open. This is useful for not continually repeat the same indentation settings. To do this you can choose two ways:

1
2
3
4
5
6
7
8
9
/ / Individually
. defaults . closeOnEscape = false ; $. Ui. Dialog. Defaults. CloseOnEscape = false;
. defaults . modal = true ; $. Ui. Dialog. Defaults. Modal = true;

/ / All together
$. ui . dialog . defaults , { $. Extend ($. Ui. Dialog. Defaults, {
, closeOnEscape: false,
modal: true
});

Obviously, when you go to open a dialogue you can always override the global settings:

1
2
3
4
5
) . dialog ( { $ ('# MyDialog'). Dialog ({
, title: 'My dialogue'
, modal: false,
closeOnEscape: true
});

One Response to "Set the options of dialogue jQuery UI in a comprehensive manner"

  1. July 7, 2009 gabriele :

    Quick Note: once opened a dialog , then closed by the visitor of the page to reopen must state the following command:

    1
    ) . dialog ( "open" ) ; $ ("# Box_dialogo.") Dialog ("open");

    If you refer only dialog(); will not open!
    g.

Leave a comment

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL