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 }); |










Quick Note: once opened a
dialog, then closed by the visitor of the page to reopen must state the following command:If you refer only
dialog();will not open!g.