[英]How to Disable a parent page when a RadWindow opens without set_modal(true)
在不设置set_modal属性值为true的情况下打开RadWindow时如何禁用父页面?
var oWnd = radopen(finalURL, null, width, height);
oWnd.setUrl(finalURL);
oWnd.set_modal(true); //// Without this line ?
oWnd.set_visibleStatusbar(false);
oWnd.show();
return oWnd;
在旧版本的iframe中,由于IE错误,可能会在IE下引发错误。 此问题在更高版本中已修复,因此您应该升级。 此处提供更多详细信息: http : //www.telerik.com/support/kb/aspnet-ajax/window/details/opening-a-modal-radwindow-on-page-load-inside-radwindow-under-ie9-和-ie10 。
解决此问题的方法实质上是在对话框出现之前集中某些内容,例如:
function fix()
{
document.documentElement.focus();
Sys.Application.remove_load(fix);
}
Sys.Application.add_load(fix);
否则,您可以使用自己的div模仿模式背景div。 这是一个示例(即使它针对RadNotification控件也是如此: http : //www.telerik.com/support/kb/aspnet-ajax/notification/details/how-to-make-a-modal-radnotification 。
这是本质:
function showModalDiv(sender, args)
{
if (!modalDiv)
{
modalDiv = document.createElement("div");
modalDiv.style.width = "100%";
modalDiv.style.height = "100%";
modalDiv.style.backgroundColor = "#aaaaaa";
modalDiv.style.position = "absolute";
modalDiv.style.left = "0px";
modalDiv.style.top = "0px";
modalDiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)";
modalDiv.style.opacity = ".5";
modalDiv.style.MozOpacity = ".5";
modalDiv.setAttribute("unselectable", "on");
modalDiv.style.zIndex = (sender.get_zIndex() - 1).toString();
document.body.appendChild(modalDiv);
}
modalDiv.style.display = "";
}
function hideModalDiv()
{
modalDiv.style.display = "none";
}
还有一些事件处理程序:
和一些CSS以确保贴合视口:
html, body, form
{
margin: 0;
padding: 0;
height: 100%;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.