1

我的 UI 对话框有问题。

关闭对话框并重新打开后,对话框会出现两次。一个带有旧表单数据(我不想要)的对话框和一个新的空对话框。

我通过以下方式提交表单后关闭对话框:

$('.ui-dialog-titlebar-close').click();

我也试过这样关闭它:

$(this).closest('.ui-dialog-content').dialog('close');

有没有人经历过类似的行为?

4

3 回答 3

3

关闭时确保对话框自毁..

$("#dialog").dialog({
  .
  .
  .
  close: function(){
     $(this).dialog("destroy");// I also use .remove() but its redundant
  }
});
于 2012-08-28T09:58:43.917 回答
0

试试.dialog( "destroy" )方法。 Dialog.destroy

$(this).closest('.ui-dialog-content').dialog('destroy');
于 2012-08-28T09:53:18.700 回答
0

试着放

          event.preventDefault():

这可以阻止这样的行为

于 2012-08-28T09:55:53.960 回答