а

How to run a custom script to update the database after add/edit/delete


#1

Hello,

I would like to run a custom script to update my database after any add, edit or delete in Scheduler in Month, Day, Week views. Can you please point me how to do this? Is there an event handler that could watch for add/edits/delete and then sent the event parameters (id, startdate, enddate) to the external php script.

Many thanks for your help as I am not sure where to start with this.


#2

Hello @Celena,

As I understand, you want to handle add, edit or delete in the browser and then send requests to the server.

The next API events can be useful for you:

onEventAdded (when the user adds a new event to the scheduler)
https://docs.dhtmlx.com/scheduler/api__scheduler_oneventadded_event.html

onEventChanged (occurs after the user has edited an event and saved the changes (after clicking on the edit and save buttons in the event’s bar or in the details window) )
https://docs.dhtmlx.com/scheduler/api__scheduler_oneventchanged_event.html

onDragEnd (fires when the drag/resize operation is finished)
https://docs.dhtmlx.com/scheduler/api__scheduler_ondragend_event.html

onEventDeleted (fires after the specified event was deleted )
https://docs.dhtmlx.com/scheduler/api__scheduler_oneventdeleted_event.html

onEventSave (fires when the user clicks on the ‘save’ button in the lightbox (edit form) )
https://docs.dhtmlx.com/scheduler/api__scheduler_oneventsave_event.html