The OnClientAppointmentInserting client-side event is called before an appointment is inserted.
Two parameters are passed to the event handler:
sender is the scheduler client object.
eventArgs has the following methods:
get_startTime() returns the starting date and time for the appointment.
get_targetSlot() returns the Time Slot at which the appointment is being inserted.
get_isAllDay() returns True if the inserted appointment defaults to anall-day event (as in Month View), or False if the new appointment starts at the time returned by get_startTime().
set_cancel() lets you permit or block the insertion of the appointment.Calling set_cancel(true) stops the insertion, while set_cancel(false) allowsthe scheduler to bring up an edit form or in-line editor for the appointment.
This example prevents the user from inserting appointments that have already happened: