Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect jquery ui dialog on close

I tried different ways to do this but i cant get it work. this is the code:

    $.ui.dialog.defaults.bgiframe = true;
$(function() {
    $("#category_edit_dialog").dialog({
        width: 960,
        hide: 'slide',
        position: 'top',
        show: 'slide',
        close: function(event, ui) { redirect here? how? }
    });
    });
});

Thanks dekomote for helping me. At his advice i solved the problem: here is the full working code:

 $.ui.dialog.defaults.bgiframe = true;
$(function() {
    $("#category_edit_dialog").dialog({
        width: 960,
        hide: 'slide',
        position: 'top',
        show: 'slide',
        close: function(event, ui) { location.href = 'url here' }
    });
});
like image 825
ciprian Avatar asked Sep 19 '10 11:09

ciprian


People also ask

What is closeclose () event in jQuery UI dialog?

close ( event, ui ) : Triggers when we click on close button in the dialog. There is callback function attached to this close. How to remove close button from jQuery UI dialog using jQuery ?

How do I Close a jQuery-UI dialog window?

Edit: Ah, I see now you're talking about jquery-ui dialogs, which are made via CSS. You can hook the X which closes the window by registering a click handler for the element with the class ui-dialog-titlebar-close .

What's new in jQuery UI CLOSE?

What's New ? jQuery UI Close event is triggered when the dialog box is closed. Learn more about jQuery selectors and events here. First, add jQuery Mobile scripts needed for your project.

How to disable the dialog in jQuery?

close () method is used to disable the dialog. This method does not accept any argument Approach: First, add jQuery UI scripts needed for your project. Writing code in comment?


1 Answers

    $.ui.dialog.defaults.bgiframe = true;
    $(function() {
        $("#category_edit_dialog").dialog({
            width: 960,
            hide: 'slide',
            position: 'top',
            show: 'slide',
            close: function(event, ui) { window.location.href = "page.html"; }
        });
        });
    });

where "page.html" is the page you wish to redirect to on close

like image 77
chris.rickard Avatar answered Sep 30 '22 15:09

chris.rickard