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

前端 未结 4 811
悲&欢浪女
悲&欢浪女 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条回答
  •  抹茶落季
    2020-12-28 19:50

    You can open any number of modals and the default behavior is stacking in the order they were opened.

    Demo: jsFiddle

    $('#dialog-modal').dialog({
        height: 300,
        modal: true,
        buttons: {
            'Another Modal': function() {
                $('#another-dialog-modal').dialog('open');
            },
            Cancel: function() {
                $(this).dialog('close');
            }
        }
    });
    
    $('#another-dialog-modal').dialog({
        autoOpen: false,
        buttons: {
            Cancel: function() {
                $(this).dialog('close');
            }
        }
    });
    

提交回复
热议问题