In jquery UI dialog, is it possible to put a modal dialog on top of another modal dialog

前端 未结 4 798
悲&欢浪女
悲&欢浪女 2020-12-28 19:05

I have a modal dialog using jquery UI dialog. I now want to popup another dialog when i user changes a field in the first dialog. Both should be modal.

Is this po

4条回答
  •  -上瘾入骨i
    2020-12-28 19:40

    UI dialogs are not singleton You can open as many dialogs as you want. And by default they are stacked. but when Dialog get focused it came up infront of other dialogs.

    here is fiddle i created for you. Open dialog from first dialog

    // HTML:
    
    Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.
    Second Modal yayyay
    // JS: $( "#dialog-modal" ).dialog({ height: 300, modal: true, buttons: { Cancel: function() { $(this).dialog('close'); } } }); $("#dialogSelect").change(function(){ $( "#another-dialog-modal" ).dialog('open'); }); $( "#another-dialog-modal" ).dialog({ autoOpen: false, modal: true, buttons: { Cancel: function() { $(this).dialog('close'); } } });

    I've put drop down on first dialog and on change event I opened another dialog above the first dialog.

提交回复
热议问题