ui.dialog: how to best control what happens after a dialog is closed?

ui.dialog: how to best control what happens after a dialog is closed?


hello !
I'm trying to use jquery ui library for the first time for a content
administration interface.
For the moment i'm using Tabs in ajax mode and the Dialog UIs.
It works quite well: My screen is organized in 4 tabs. Each tab
controls a specific part of the application, and sometimes forms.
That's where it gets a bit messy for me: i display ajax call results
in the Dialog box. But i'm facing this: i would like to refresh the
current Tabs interface after the dialog is closed.
What is the best way to achieve that ?
Here is the code i have so far:
$("#tabs").tabs({
load: function(event, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
return false;
});
}
});
// modal dialog
$.ui.dialog.defaults.bgiframe = true;
$("#dialog").dialog({
modal: true,
autoOpen: false
});
// form plugin
$('form.ajax').livequery(function(){
var options = {
target: '#dialog',
success: function(){
$("#dialog").dialog('open').bind('dialogclose',
function(event, ui) {
window.location.href= 'users.php?todo=list'; //
that sort of works but this needs to be dynamic, the href will change
depending on the form submitted.
});
},
buttons: {
"Ok": function() {
$(this).dialog("close");
}
}
};
$(this).ajaxForm(options);
});
Thank you for your help,
Alexandre