jQuery.ui.domwindow - demo - deferredopen

async open

Pass the function like below if you want to make custom deferred dialog open.
This may be useful when you need to load resource from template source manager or something.

$(function(){
    $('#defopen-open').click(function(){
        window.domwindowApi.open(function(defer){
            // prepare html from somewhere asyncly
            $.ajax({
                url: 'dialog1.html',
                dataType: 'text'
            }).done(function(data){
                setTimeout(function(){
                    defer.resolve(data);
                }, 2000);
            });
        }, {
            width: 400,
            height: 400
        });
    });
});