I'm trying to open several dialogs one after another.(1st dialog opens and makes an ajax request. If success show the 2nd dialog) The problem is, the first dialog opens correctly in the middle of the screen but when I close it the second dialog opens at the top of the page not in the center.
I have all the jquery ui dependencies in place since I used the build page and selected everything.
I tryed all of these: 1 2 and 3 with no success.
The project is big, so I'm creating some make up code close to the one I'm using.
First, open the dialog
$(".btblock").click(function (event) {
event.preventDefault();
var btn = $(this);
var id= btn.attr('id');
$("#divDialog1").dialog({
dialogClass: 'notitle',
modal: true,
zIndex: 10002,
resizable: false,
closeOnEscape: false,
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
},
buttons: {
"Ok": function () {
//Here I call another function which is an ajax call.
//when the ajax call is completed (success or not) I call
//another function which creates the second dialog with results
$(this).dialog("close");
}
}
});
});
//Function called after ajax call. creats a result dialog
//This Dialog doesn't show in the middle of the screen
function customAlertMessage(title, message) {
var div = '<div style="text-align:center;" title="' + title + '">' + message + '</div>'
$(div).dialog({
resizable: false,
dialogClass: 'notitle',
modal: true,
buttons: {
"Ok": function () {
$(this).dialog("close");
}
}
});
}