关闭Sitecore 7.1中的模态对话框?

时间:2014-01-28 22:00:51

标签: sitecore sitecore7 sitecore7.1

我有一个自定义对话框,可以使用以下调用打开ASPX页面:

Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog("/path/to/my/dialog.aspx");

在Sitecore 7.1之前,我已经能够关闭模态对话框并使用以下JavaScript代码段传回一个值:

if (window.opener) {
  window.opener.top.returnValue = 'success';
}
window.returnValue = 'success';
window.close();

由于我的对话框使用ASPX页面,因此我无法使用Sitecore.Context.ClientPage.ClientResponse.CloseWindow();来关闭它(因为Sheer UI框架不存在)。不幸的是,我的自定义对话框非常复杂,我的项目时间表让我没有时间将其重写为SPEAK UI应用程序。

话虽如此,由于新的jQuery驱动模式对话框,上述JavasScript解决方法已停止在Sitecore 7.1中工作。我想知道是否有人知道如何关闭Sitecore 7.1模式对话框并传回一个值?

1 个答案:

答案 0 :(得分:5)

您可以致电window.top.dialogClose();

这应该可以解决问题。