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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.02.2010, 13:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
CRM DE LA CREME! Hides the associated Views buttons/More Actions menu drop down
Источник: http://crmdelacreme.blogspot.com/201...ttonsmore.html
==============

/* Hides the associated Views buttons. i.e Hides the add existing button. */
/* NB: If called multiple times, the settings of the previous calls are overwritten by the final one! */
/* A menu element on the "More actions" drop-down menu can be hidden
* by adding a string such as 'More Actions::Activate' to the buttonTitles array.
*/
HideAssociatedViewButtons = function(loadAreaId, buttonTitles)
{
var navElement = document.getElementById('nav_' + loadAreaId);
if (navElement != null)
{
navElement.onclick = function LoadAreaOverride()
{
// Call the original CRM method to launch the navigation link and create area iFrame
loadArea(loadAreaId);
HideViewButtons(document.getElementById(loadAreaId + 'Frame'), buttonTitles);
}
}
}

/* Used internally by the 'HideAssociatedViewButtons' method */
HideViewButtons = function(Iframe, buttonTitles)
{
if (Iframe != null)
{
Iframe.onreadystatechange = function HideTitledButtons()
{
if (Iframe.readyState == 'complete')
{
var iFrame = frames[window.event.srcElement.id];
var liElements = iFrame.document.getElementsByTagName('li');
for (var j = 0; j < buttonTitles.length; j++)
{
buttonTitleParts = buttonTitles[j].split('::');
if (buttonTitleParts.length > 0)
{
buttonTitle = buttonTitleParts[0];
for (var i = 0; i < liElements.length; i++)
{
liElement = liElements[i];
if (liElement.getAttribute('title') == buttonTitle)
{
if (buttonTitleParts.length == 1)
{
liElement.style.display = 'none';
break;
}
else
{
/* We want to hide a menu item in a drop-down menu.
Find the descendant text element with the specified text.
Then find its parent list item and hide it:
*/
menuText = buttonTitleParts[1];
var spanElements = liElement.getElementsByTagName('span');

for (var k = 0; k < spanElements.length; k++)
{
spanElement = spanElements[k];
if (spanElement.className == 'ms-crm-MenuItem-Text' )
{
textElement = spanElement.firstChild;
if (textElement != null && textElement.nodeType == 3) /* 3 = Node.TEXT_NODE */
{
if (textElement.data == menuText)
{
liMenuItemElement
= spanElement.parentNode.parentNode.parentNode;
liMenuItemElement.style.display = 'none';
break;
}
}
}
}
}
}
}
}
}
}
}
}
}


Источник: http://crmdelacreme.blogspot.com/201...ttonsmore.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! Hiding Navigational Items based on drop down value Blog bot Dynamics CRM: Blogs 0 31.08.2009 18:05
CRM DE LA CREME! Microsoft CRM 4.0 Update Rollup Best Practices Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
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
CRM DE LA CREME! Hiding Button's on related views in CRM Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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