Search code examples
sharepoint-2007

hiding actions menu in sharepoint list


i am using the following code to hide the Actions menu from Discussion Board list. The code is :

<script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.js"></script> 
<script type="text/javascript" language="javascript"> 
    $(document).ready(function(){ 
        $('.ms-menutoolbar td:lt(4)').hide(); 
    }); 
</script>

I found this from an article, but its not working. Can you please help me regarding hiding Actions menu from Discussion Board list.

Also tried this code with no luck:

<script>
function HideDiv(name) {
    var div = document.getElementsByTagName('div');
    for (var i = 0; i < div.length; i++) {
        var str = div[i].id;
        if (str.indexOf(name) >= 0) {
            var viewInExplorer = div[i];
            if (viewInExplorer != null) {
                if (viewInExplorer.parentNode != null)  
                    viewInExplorer.parentNode.removeChild(viewInExplorer);
            }
        }
    }
}
HideDiv("ListActionsMenu");
</script>

Solution

  • You can use the below script but i would suggest to use custom master page in which you just remove site action or apply a sharepoint security trim control so that it is visible to administrator only

    <script type="text/javascript" > this.document.getElementById("siteactiontd").style.display = 'none'; </script>