Hi partners have a nice day, i have one div to show one dialog it is created fine when is called for first time, but when is called in subsecuent times one error appear .
My question is
How to check if it dialog exists?, if it exists only must be showed and not created .
<div id="dialog_cambiaPassword"></div>
My function for create the dialog is it:
function openDialog() {
//var dialog_pass = $("#dialog_cambiaPassword");
var dlg = $('#dialog_cambiaPassword').dialog({
title: 'AgendaNet',
width: 400,
height: 200,
closed: true,
resizable: false,
href: 'cambiaPassword.html',
modal: true,
buttons: [
{
iconCls: 'icon-save',
text: 'Grabar',
handler: function () {
alert('save');
}
},
{
iconCls: 'icon-cancel',
text: 'Cancelar',
handler: function () {
//$('#dialog_cambiaPassword').dialog('close');
//$('#dialog_cambiaPassword').dialog('destroy');
dlg.dialog('destroy')
}
}
]
});
$('#dialog_cambiaPassword').dialog('open');
}