4

In my sharepoint 2013 list dispform.aspx, I have one webpart with 'save' button . Once that save button is clicked i want to disable the 'Edit Item' OOTB option from the ribbon . How can i achieve that using javascript

  • you can use PowerShell using CSOM framework. That's the recommended approach. – userAZLogicApps Jan 25 '16 at 6:27
  • @samolpp, PowerShell from a custom action seems overcomplicated – Robert Lindgren Jan 25 '16 at 6:36
  • @RobertLindgren , I have provided the answer using js , below. mohammed, you can try the below solution. – userAZLogicApps Jan 25 '16 at 6:50
3

Insert Script editor webpart and on click on the button add and call this function

<script type="text/javascript">
    function hideEdit() {
        var edit = document.getElementById("Ribbon.ListForm.Display.Manage.EditItem-Large");
        edit.style.display = "none";
    }       
    _spBodyOnLoadFunctionNames.push("hideEdit");
</script>

https://social.technet.microsoft.com/Forums/office/en-US/d10c9895-a9c7-4189-a312-d20664d94dfc/hide-button-in-ribbon-bar-in-dispformaspx?forum=sharepointgeneral

3
 <script type="text/javascript">
   function hideEdit() {
      var edit = 
      document.getElementById("Ribbon.ListForm.Display.Manage.EditItem-
      Large");
      edit.style.display = "none";
     }       
    _spBodyOnLoadFunctionNames.push("hideEdit");
  </script>

Another approach : You can have a look at here

0

To disable the edit item menu.

  1. Go to settings >> edit page
  2. click the drop-down >> Edit Web Part (see diagram below) Editing web part

  3. On the list views dialog box; Go to toolbox type >> select No Toolbar (see diagram below) list views dialog box

  4. Apply >> Ok to Save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.