Monday, July 2, 2012

Hide New Item and Action item menu of Sharepoint list

<script type='text/javascript'>//hide the new item menu and Action item menu._spBodyOnLoadFunctionNames.push(
_spBodyOnLoadFunctionNames.push(
"HideNewItem");"HideActionsItems");function
{





{

{

newElem.parentElement.parentElement.style.display
newElem.parentElement.parentElement.nextSibling.style.display
}
}
}

}
HideNewItem()try{var tables = document.getElementsByTagName("table");for(var i=0; i< tables.length; i++)if( tables[i].id.indexOf("NewMenu") > 0 )var newElem = tables[i];="none";="none";catch(e){}function
{
HideActionsItems()try



{

{


divs[i].style.display
}
}
}

}
{var divs = document.getElementsByTagName("div");for(var i=0; i< divs.length; i++)if( divs[i].id.indexOf("ActionsMenu") > 0 )var newElem = divs[i];="none";catch(e){} </script>

No comments:

Post a Comment