I dont want the cross for closing the dialog box to appear in the dialog box im creating. How can I do that?
Also, if on clicking on the cross in the dialog I want to have destroy and not close, how can I do that?
I dont want the cross for closing the dialog box to appear in the dialog box im creating. How can I do that?
Also, if on clicking on the cross in the dialog I want to have destroy and not close, how can I do that?
You don't want the X, but if it is clicked, you want to destroy the box? You have to decide on one or the other.
But to destroy it on close, the following should work (you'll have to modify the selector with whatever class or ID you're using):
$(".selector").dialog({
close: function(event, ui) {
$(this).dialog("destroy");
}
});
Edit for below comment:
As far as I can see, there is no option to disable the button. However, you can hack it by hiding it (untested):
$(".selector").dialog({
open: function(event, ui) {
//$(".ui-dialog-titlebar-close").hide();
$("a.ui-dialog-titlebar-close").remove(); //courtesy of user281180, see below
}
});