none
Call custom function on event delete RRS feed

  • Question

  • Hi All,

    I want to call custom function on event delete click on calendar event display form.

    

    Please let me know how this can be done.


    Thanks in Advance, Jiniv Thakkar

    Friday, December 13, 2019 4:18 PM

Answers

  • Hi Jiniv,

    Please override the Delete Item action in Calendar Display form like this:

    <script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
     //for view form
     var button = document.getElementById("Ribbon.ListForm.Display.Manage-LargeMedium-1-2");
     if (button != null) {
         var $button = $(button);
         var html = $button.html();
         $button.after("<div id='deleteIcon' OnMouseOver='ApplyCSSFunction()'><a style='cursor:pointer;'>" + html + "</a></div>").hide().next().click(function (e) {
             TestFunction();
         });
         $(".ms-cui-ctl-mediumlabel:eq(3)").css("vertical-align","top");
         $(".ms-cui-ctl-mediumlabel:eq(3)").css("margin-left","4px");
         $('.ms-cui-ctl-mediumlabel:eq(3)').text("Delete Item");
         }
      
     $("#deleteIcon").mouseleave(function() {
            $("#deleteIcon").css("border-style","none");
             });
     });
     
     function TestFunction()
     {
    	 alert("test");
     }
    </script>
    

    Reference:

    Step By Step Procedure To Create A Custom Action For Delete Button On SharePoint List Form Ribbon Using JavaScript

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, December 16, 2019 4:16 AM

All replies