$("#termSheetPrinted").dialog({
autoOpen: false,
resizable: true,
height: $(window).height() - 50,
width: $(window).width() - 50,
position: 'center',
title: 'Term Sheet',
beforeClose: function(event, ui) { $("#termSheetPrinted").html(''); },
modal: true,
buttons: {
"Print": function () {
$("#termSheetPrinted").jqprint();
},
"Cancel": function () {
$("#termSheetPrinted").html('');
$(this).dialog("close");
}
}
});
因此,当我单击“取消”时,我可以再次生成对话框,一切看起来都很好。如果我单击右上角的“X”并再次生成它,它会加倍,从上次开始就没有被清除。
我尝试添加beforeClose
事件以清除 HTML,但它似乎不起作用。
如何从“取消”和点击“X”中正确清除和关闭它?