onBeforeEventChanged

fires when the event has been changed by drag-n-drop, but the changes aren't saved yet.

boolean onBeforeEventChanged(object ev,Event e,boolean is_new,object original);
evobjectthe event's data object after changes
eEventa native event object
is_newbooleanreturns 'true', if the user changes a new event. 'false' - if the edited
event already exists
originalobjectthe event's data object before changes
booleandefines whether the default action of the event will be triggered (true) or canceled (false)

Example

scheduler.attachEvent("onBeforeEventChanged", function(ev, e, is_new, original){
    //any custom logic here
    return true;
});

Details

The event occurs when a new "event" is added or an existing one is changed by drag-n-drop action.

  • Beware that the 1st parameter of the handler function takes the data item object, not the data item's id (because newly created data items may not have ID yet).
  • Unmodified event would be an empty object in case of creating new data items.
  • The event is blockable: returning false from the handler will prevent data update.
Back to top