Showing posts with label Java Script. Show all posts
Showing posts with label Java Script. Show all posts

Monday, January 10, 2011

Hiding Left Navigation Groups and Toolbar icon

Hiding icon from MS Dynamics CRM toolbar.


HidePaperClip = function() {
var toolBarButtons = document.all.mnuBar1.rows[0].cells[0].childNodes[0].childNodes;
var btnTitle = "Attach a File";
//Loop through each button
for (var i = 0; i < toolBarButtons.length; i++) {
var button = toolBarButtons[i];
if (button.title.match(btnTitle) != null) {
button.nextSibling.style.display = "none";
button.style.display = "none";
}
}
}



Hiding nvaigation group from MS Dynamics CRM's left navigation panel.

HideSubNav = function() {
var nav = document.all.crmNavBar.childNodes;
var count = 0;
for (var i = 0; i < nav.length; i++) {
var li = nav[i];
if (li.className == "ms-crm-Nav-Group") {
if (count!=0) li.style.display = "none";
count++;
}
}
}