Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery modal dialog opens not modal at first time
    primarykey
    data
    text
    <p>I have the following Problem:</p> <p>I have already opened a JQuery dialog and I want to overlay it with another modal dialog to cover this and display some other functions/information.</p> <p>I fill the second dialog with data fetched by an ajax request. The problem is, that the second dialog does not open modal at first click. When I close it, and reopen it, the dialog is modal.</p> <p>My code looks like follows: I create the dialog in a that already exists in the body</p> <pre><code>function showMachineControlDialog(id) { loadMachineControlDialog(id); var buttonsOpts = {}; buttonsOpts["Close"] = function() { $(this).dialog("close"); }; $("#machine_control_box").dialog({ buttons : buttonsOpts }); $("#machine_control_box").dialog({ width: 250, resizable: false }); $("#machine_control_box").dialog( "option", "title", "Control-Dialog" ); $("#machine_control_box").dialog({ zIndex: 2000 }); $("#machine_control_box").dialog({ closeOnEscape: true }); $("#machine_control_box").dialog({ modal: true }); $("#machine_control_box").dialog({ autoOpen: false }); } </code></pre> <p>Here i fetch the data that is pushed into the dialog box:</p> <pre><code>function loadMachineControlDialog(id) { var paramlist = "id="+id; $.ajax({ type: "GET", dataType: "html", url: "getData", data: paramlist, contentType: "application/x-www-form-urlencoded;charset=UTF-8", cache: false, success: function(data){ $("#machine_control_box").html(data).dialog("open"); $("#machine_control_box").dialog({ position : 'center' }); }, error: function(data){ showErrorDialog(data.responseText); } }); } </code></pre> <p>I found the fix myself after some search. I have to set the modal attribute BEFORE any HTML is inserted into the dialog. If modal is set after that it won't work for some reason.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload