none
How to hide "Edit Item" in a sharepoint list context menu(ECB) ?

    Question

  • How to hide "Edit Item" in a sharepoint list context menu(ECB) ?

    i want ot use content editor webpart to write scripting

    Thursday, May 10, 2012 5:35 AM

Answers

  • Hi Aneesh,

    use the following script to hide the Edit Item in ECB.

    $(document).ready(function(){
     $('.ms-MenuUIPopupBody').live('mouseover', function() {         
               $('#ID_EditItem').remove();
             }); 

        });

    by

    Vadivelu B

    Thursday, May 10, 2012 11:41 AM
  • Hi i modified the code like this and now its working...

    <script language="javascript" type="text/javascript">
    $(document).ready(function(){
     $('.ms-MenuUIItemTableHover').live('mouseover',function() {        
    $("tr[text='Edit Item']").remove();

             });

        });

    </script>

    But i would like to remove the edit item row on load itself and not on mouseover

    Friday, May 11, 2012 5:30 AM

All replies

  • Hi Aneesh,

    use the following script to hide the Edit Item in ECB.

    $(document).ready(function(){
     $('.ms-MenuUIPopupBody').live('mouseover', function() {         
               $('#ID_EditItem').remove();
             }); 

        });

    by

    Vadivelu B

    Thursday, May 10, 2012 11:41 AM
  • hi anna,

    i have added in content editor like this

    <script type="text/javascript">

    $(document).ready(function(){
     $('.ms-MenuUIPopupBody').live('mouseover', function() {         
               $('#ID_EditItem').remove();
             }); 

        });

    </script>

    But still the edit item is not hiding...

    anything else to be added with this?

    I am very poor in coding

    pls help.

    thank you for your most valuable help...

    Friday, May 11, 2012 3:48 AM
  • Hi i modified the code like this and now its working...

    <script language="javascript" type="text/javascript">
    $(document).ready(function(){
     $('.ms-MenuUIItemTableHover').live('mouseover',function() {        
    $("tr[text='Edit Item']").remove();

             });

        });

    </script>

    But i would like to remove the edit item row on load itself and not on mouseover

    Friday, May 11, 2012 5:30 AM
  • 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


    Falco - http://www.msscorner.de

    Friday, May 11, 2012 5:51 AM
  • Thanks for your reply...
    I have given the reference before the starting of javascript..

    Now with the above mentioned coding the edit item is appearing on clicking the ECB menu, on mouseover, it disappears... i want to make it disappear on load itself.

    Friday, May 11, 2012 6:03 AM
  • If you don't give users permission to edit items in the list, that option will automatically be hidden for you from the context menu.

    If for whatever reason you need remove the "Edit Item" from context menu while keeping their edit permission, here's an alternative suggestion. Use SharePoint designer to create a data view of that list. You have full control of how list will look like.



    Pman
    http://www.pmansLab.com/


    • Edited by Parvez Akkas Saturday, May 12, 2012 4:21 PM Added some more info
    Saturday, May 12, 2012 4:18 PM
  • Can you give me the exact link ?
    Monday, May 14, 2012 5:45 AM
  • hi

    Can you give me the exact link ?

    If you don't give users permission to edit items in the list, that option will automatically be hidden for you from the context menu.

    If for whatever reason you need remove the "Edit Item" from context menu while keeping their edit permission, here's an alternative suggestion. Use SharePoint designer to create a data view of that list. You have full control of how list will look like.



    Pman
    http://www.pmansLab.com/



    Monday, May 14, 2012 6:08 AM
  • exact link to what?


    Pman
    http://www.pmansLab.com/

    Tuesday, May 15, 2012 1:08 AM