2
$("#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”中正确清除和关闭它?

4

1 回答 1

2

如果我将其绑定到,似乎可以工作close

这不应该双向工作吗?

于 2011-06-06T15:49:23.670 回答