Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#3692 closed bug (notabug)

Dialog does not display when reopened

Reported by: jburgess Owned by:
Priority: major Milestone:
Component: ui.dialog Version: 1.6rc2
Keywords: Cc:
Blocked by: Blocking:

Description

If I open a dialog box, close it, and then try to re-open it again, the dialog is displayed the first time but not the second time. When the dialog opens the second time, the titlebar is visible but the main dialog contents are not.

My code is as follows:

(dialog html)

          <div class='dialog_wrapper' style='display: none;'>
            <div class='dialog'>
                w00t
            </div>
          </div>

(dialog display code)

          <script type='text/javascript'>
            //<![CDATA[
              function open_dialog() {
                jQuery(".dialog_wrapper").dialog({
                    draggable: false,
                    height: 265,
                    width: 350,
                    modal: true,
                    overlay: { 
                        opacity: 0.5, 
                        background: "#000000" 
                    },
                    resizable: false
                }).show();
              }
            //]]>
          </script>

(the link)

          <a href='#' onClick='open_dialog();'>Open dialog</a>

I took a cursory glance, and it appears that the wrapper divs are not being removed when the dialog is closed. Perhaps that is the problem?

Change History (3)

comment:1 Changed 11 years ago by wichert

They are only removed if you destroy the dialog. If you only close the dialog you can reopen it by issuing a show command.

comment:2 Changed 11 years ago by Scott González

Resolution: invalid
Status: newclosed

Wichart is correct. You cannot re-initialize a dialog if it hasn't been destroyed. What you probably want to do is initialize the dialog with autoOpen: false and then have your link call $('.dialog_wrapper').dialog('open');

comment:3 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.