簡體   English   中英

如何在沒有set_modal(true)的情況下打開RadWindow時禁用父頁面

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM