locked
Hide context menu item of partiular document library on Site collection RRS feed

  • Question

  • Hi Friends ,

    i have 10 document library on my site for this library i have created one custom contxt menu which is visible on all (10) document library but i want to hide this custom context menu for one library and it should be visible for rest 9 library. Please suggest how i can achieve this.. please sahre link/ code .

    Thanks!


    Regard, Ravindra Patil

    Thursday, September 13, 2012 7:50 AM

All replies

  • hi

    if by context menu you meant ECB (edit control block), then this post shows how to hide items in the ECB of the list via javascript: Hiding Menu Items in the ECB from SharePoint List Items. Using this technique you may hide ECB. The only thing which you need to add is to determine whether the user is currently located in the doclib where you need to hide ECB. You can do it by embedding server code to js like this:

    if ('<%= SPContext.Current.List.Title %>' == 'Test')
    {
        // call the code which will hide ECB
    }

    Blog - http://sadomovalex.blogspot.com
    CAML via C# - http://camlex.codeplex.com

    Thursday, September 13, 2012 8:31 AM