Below JavaScript can be used to disable menu options under SharePoint List Actions menu.
<script type="text/javascript">
function GetElementByText(tagName, title)
{
var a = document.getElementsByTagName(tagName);
for (var i=0; i < a.length; i++)
{
if (a.item(i).text)
{
if (a.item(i).text == title)
{
return a.item(i);
}
}
}
return null;
}
function hideMenuItems()
{
/*var o = GetElementByText("ie:menuitem","New Item");
if (o)
{
o.disabled = true;
}*/
var o = GetElementByText("ie:menuitem","Edit in Datasheet");
if (o)
{
o.disabled = true;
}
var o = GetElementByText("ie:menuitem","View RSS Feed");
if (o)
{
o.disabled = true;
}
var o = GetElementByText("ie:menuitem","Alert Me");
if (o)
{
o.disabled = true;
}
}
_spBodyOnLoadFunctionNames.push("hideMenuItems");
</script>
No comments:
Post a Comment