Custom delete action for schedule

Is it possible to have a custom function called when an event is deleted from the schedule?


1 Reply

VR Vijay Ravi Syncfusion Team January 27, 2023 02:01 PM UTC

Hi Nicholas


You can disable the default delete action and perform your custom delete action with help of the actionBegin event of the Schedule.


[index.cshtml]

<ejs-schedule id="schedule" height="550" selectedDate="new DateTime(2018, 2, 15)" actionBegin="onActionBegin">

</ejs-schedule>

 

<script type="text/javascript">

    function onActionBegin(args) {

        var scheduleObj = document.getElementById('schedule').ej2_instances[0];

        if (args.requestType === 'eventRemove' && args.data.length > 0) {

            args.cancel = true;

            // you can perform your custom delete operation here.

        }

    }

</script>


Regards,

Vijay Ravi


Attachment: custom_delete_action_afcbbd06.zip

Loader.
Up arrow icon