Perform CRUD Actions Dynamically in ASP.NET MVC Scheduler
CRUD actions can be manually performed on appointments using the addEvent, saveEvent, and deleteEvent client-side methods, as shown below. This is useful when you need to create, update, or remove appointments programmatically in response to a custom UI action instead of using the built-in editor window.
NOTE
The methods shown in this section operate on the Scheduler’s local event collection. To persist the changes to a server-side store, handle the
actionBeginandactionCompleteevents and forward the payload to your data source.
Prerequisites
Before proceeding, ensure that:
- The Syncfusion ASP.NET MVC Scheduler is installed and the required client-side resources (
ej2-schedule,ej2-base, andej2-data) are referenced in your view or layout. Theej2-datapackage is required because the recurrence example usesej.data.DataManagerandej.data.Query. - The
using Syncfusion.EJ2.Schedulenamespace is included in the view.
Normal event
The following example demonstrates how to add a new appointment, edit an existing appointment, and delete an appointment using addEvent, saveEvent, and deleteEvent respectively. Click the ADD, EDIT, and DELETE buttons to trigger each action.
Recurrence event
The following example shows how to programmatically add, edit, and delete recurring appointments. When editing or deleting a recurring appointment, the second argument to saveEvent and deleteEvent specifies the edit type (for example, EditOccurrence to edit a single occurrence, or DeleteSeries to delete the entire series). The valid values are EditOccurrence, EditSeries, DeleteOccurrence, and DeleteSeries.