Before update or adding event

Hi,

I have any rules that must be respected before adding or upadting an event.
For example :

  • between the start of the first events of day and the end of the last event of the same day, i have to check if there is egal or less than 11 hours.
  • i have to check if the total duration of all the events of the week is less than 35 hours.

I think i need to use the onEventChanged and onEventAdded methods.
But i don’t know how to get the values needed for my rules.

Any ideas ?

Hi,
you can get needed data with scheduler.getEvents(dateFrom, dateTo), it may be used to get events for current day or week.

I think i need to use the onEventChanged and onEventAdded methods.
these events may trigger after the dataProcessor sends changes to the server,
try using onBeforeUpdate event of dataprocessor
docs.dhtmlx.com/doku.php?id=dhtm … foreupdate

Also, there is onEventSave which fires after pressing save button in the lightbox - you can place validation code there. Returning false from onEventSave event will stop lightbox closing and data saving.

Thanks a lot
i will try this.