Answered How to hide the ECB item "Edit item" from the ECB ?

  • Thursday, May 10, 2012 9:32 AM
     
     

    How to hide the ECB item "Edit item" from the ECB ?

    i have done the same before using content editor webpart coding. But i forgot it.

    Thanks in advance

All Replies

  • Thursday, May 10, 2012 10:11 AM
     
     

    Hi,

    Please take a look at this article Hide “Edit Item” Menu Item


    Dmitry

    Lightning Tools LogoLightning Tools Check out our SharePoint tools and web parts | Lightning Tools Blog

  • Thursday, May 10, 2012 10:34 AM
     
     Proposed Answer

    Hi Aneesh,

    first create customcore.xml file and reference in master page for this follow this link

    http://msdn.microsoft.com/en-us/library/cc768565.aspx

    and your customcore.xml file hide following items

    //strAction = "editDocumentWithProgID2('" + currentItemFileUrl + "', '" + currentItemProgId + "', '" + currentItemOpenControl + "', '" + bIsCheckout + "', '" + a.HttpRoot + "', '" + currentItemCheckedoutToLocal + "')";

                   // strImagePath = a.imagesPath + currentItemIcon;

                   // b = CAMOpt(c, strDisplayText, strAction, strImagePath, null, 260);

                     // b.id = "ID_EditIn_" + currentItemAppName;

                   // CUIInfo(b, "EditDocument", ["EditDocument"])

    follow this link

    http://social.technet.microsoft.com/Forums/sa/sharepoint2010customization/thread/3fdeb635-f8a7-45dd-88bd-08e02bd58eaf

    Hopefully this gives you the gist of what is required.

    Thanks

    Esubvali Sayyed

  • Friday, May 11, 2012 3:42 AM
     
     Answered

    Thaks all for your reply...
    Actually i found a very simple soultion.

    Just i changed "return false;" to "return true;" and the default menu items disappeared. We can give those default menu items if it is required in other pages(views) using camopt function.

    Thanks a lot friends...

  • Friday, July 06, 2012 3:50 AM
     
     

    Hi Aneesh,

    Can you explain the solution in more detail. Also if you know how to achieve the functionality using the content editor web part, kindly share it.

    Thanks

  • Friday, July 06, 2012 4:47 AM
     
      Has Code

    Hi Aneesh,

    did you referenced to jQuery Library? Because this is often the reason why the custom code did not work. You can reference to the newest jQuery Library like this:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" />
    <script type="text/javascript">
    //your code
    </script>

    I hope it helps.


    Mukesh Ajmera

  • Friday, July 06, 2012 4:58 AM
     
     

    Hi,

    I have added the following code in HTML source in content editor web part and added the web part below the list web part. But it doesnt work. Am still able to see version history option in ECB(on loading as well as during the mouse hover)

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script language="javascript" type="text/javascript"> 

    $(document).ready(function(){
     $('.ms-MenuUIItemTableHover').live('mouseover',function() {        
    $("tr[text='Version History']").remove();
             });

        });</script>

    Kindly let me know if i am missing anything.

  • Tuesday, July 10, 2012 9:44 AM
     
      Has Code

    Hi rakesh try this code, it works for me on SP2010:

    <script type="text/javascript"> $(document).ready(function(){ $('.ms-MenuUIULItemHover').live('mouseover',function() { $("#ID_Versions").parents('.ms-MenuUIULLink').eq(0).hide(); }); }); </script>

    Pls mark as answer if it works for you. Hope it helps!


  • Tuesday, July 10, 2012 11:11 AM
     
     

    Hi Gerald,

    Thanks for the code.But can we implement the same functionality when the ECB loads/opens instead of hovering over the menu items. 

    Thanks