I have the same problem, I open several dialog boxes, and my problem was that the contents had to be deleted so that the form data remained with the same data, then these parameters are created in the dialog box
var dialog = $("#dummy-1"); dialog.html('<div style="position:absolute; top:15px; left:0px; right:0px; bottom:0px; text-align:center;"><img align="middle" src="cargando.gif"></div>'); dialog.html(mensaje); dialog.dialog( { title:'Ventana de Confirmacion', width:400, height:200, modal:true, resizable: false, draggable:false, position: { my: "center center", at: "center center", of: window }, buttons: [ { text: "Eliminar", click: function() { functionCall(dialog,var1,var2); } }, { text: "Cerrar", click: function() { dialog.dialog("close"); } } ], close: function(event, ui) { dialog.dialog("close").dialog("destroy").remove(); } });
and the dialogue is passed as a function parameter to perform the action:
function functionCall(dialogFormulario,var1,var2) {
}
Here you only need to use .dialog ("close") and no .dialog ("destroy"), because the dialog will call its close function: and the element will not exist
KristKing May 09 '17 at 15:49 2017-05-09 15:49
source share