AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.11.2009, 08:41   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
mscrm4ever: CRM 4.0 Read Only Iframe - A better solution
Источник: http://mscrm4ever.blogspot.com/2009/...-solution.html
==============






I already posted about creating a read only iframe in the past but the solution offered here is by far better and integrates nicely with CRM.
The idea, in a nut shell, is to create an upper blocking layer inside the iframe. The layer is decorated with an alpha filter which makes it look disabled and also presents a watermark text to the user. The helper object also accepts an alert text that is shown to the user when he tries to click inside the frame.
Feel free to change the opacity, colors and fonts for best appearance. This code, as usual, should be pasted into the onload event handler and published.




function IframeReadOnlyHelper(sIframeId)
{
var iro = this;
iro.Iframe = document.getElementById(sIframeId);
if (!iro.Iframe)
{
alert("IFRAME with id " + sIframeId + " is missing");
}

iro.WatermarkText = "";
iro.AlertMessage = "";

iro.OnIframeReady = function()
{
if (iro.Iframe.readyState != 'complete')
{
return;
}

var iframeDoc = iro.Iframe.contentWindow.document;
var iframeBody = iframeDoc.body;
var roSpan = iframeDoc.createElement("SPAN");

var roStyle = "overflow:hidden;";
roStyle += "position:absolute;";
roStyle += "z-index:1;";
roStyle += "left:0px;";
roStyle += "top:0px;";
roStyle += "height:100%;";
roStyle += "text-align:center;";
roStyle += "background-color:gray;";
roStyle += "font:72px Tahoma;";
roStyle += "filter:alpha(opacity=20)";

roSpan.style.cssText = roStyle;

iframeBody.appendChild(roSpan);

if (iro.WatermarkText != "")
{
roSpan.innerHTML = "
" + iro.WatermarkText + "
";
}

if (iro.AlertMessage != "")
{
roSpan.attachEvent("onclick", function(){alert(iro.AlertMessage);});
}
}

iro.Disable = function()
{
iro.Iframe.onreadystatechange = iro.OnIframeReady;
iro.OnIframeReady();
}
}

function OnCrmPageLoad()
{
//Load IFRAME with any URL
var iframeActivity = document.all.IFRAME_account_association;
iframeActivity.src = "areas.aspx?oId=%7b50387202-6F73-DE11-9F19-0003FF230264%7d&oType=1&security=852023&tabSet=areaActivities";

//Use IframeReadOnlyHelper
var roIframe = new IframeReadOnlyHelper("IFRAME ID");
roIframe.WatermarkText = "Read Only";
roIframe.AlertMessage = "This Grid is Disabled";
roIframe.Disable();
}

OnCrmPageLoad();



Источник: http://mscrm4ever.blogspot.com/2009/...-solution.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
CRM DE LA CREME! CRM 4.0 Disaster Recovery Blog bot Dynamics CRM: Blogs 2 26.02.2016 08:23
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
mscrm4ever: CRM 4.0 Show Associated-View in IFRAME (AssocViewer) Blog bot Dynamics CRM: Blogs 0 29.05.2009 17:05
mscrm4ever: CRM 4.0 Many 2 Many IFrame Viewer Blog bot Dynamics CRM: Blogs 0 12.04.2009 16:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 16:51.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.