DayPilot.Scheduler.onEventResizing

The onEventResizing event is fired whenever the event shadow is resized during drag & drop event resizing (in real time).

Declaration

DayPilot.Scheduler.onEventResizing(args)

Parameters

  • args.allowed - set to false to forbid the operation
  • args.alt - true if Alt is being pressed (readonly)
  • args.anchor - date/time of the fixed edge (DayPilot.Date object) - the one not being resized
  • args.cssClass - CSS class to be added to the resizing shadow
  • args.ctrl- true if Ctrl key is being pressed (readonly)
  • args.duration - duration of current position (DayPilot.Duration object)
  • args.e - event object (DayPilot.Event object)
  • args.end  - end date/time of the current position (DayPilot.Date object)
  • args.html - HTML content of the shadow
  • args.left.html - HTML of the inline start indicator; default value is set to args.start.toString(calendar.eventMovingStartEndFormat)
  • args.left.enabled - when set to true, the inline start indicator is displayed; default value is set to calendar.eventMovingStartEndEnabled
  • args.left.space - space between the shadow and the left indicator, in pixels
  • args.left.width - width of the right indicator in pixels; if not specified, auto width will be used
  • args.meta - true if Meta key is being pressed (readonly)
  • args.multiresize - array of additional events being resized (each object has start, end and event properties)
  • args.rowDayPilot.Row object (since 2018.4.3506)
  • args.right.html - HTML of the inline end indicator; default value is set to args.start.toString(calendar.eventMovingStartEndFormat)
  • args.right.enabled - when set to true, the inline end indicator is displayed; default value is set to calendar.eventMovingStartEndEnabled
  • args.right.space - space between the shadow and the right indicator, in pixels
  • args.right.width - width of the right indicator in pixels; if not specified, auto width will be used
  • args.shift - true if Shift key is being pressed (readonly)
  • args.start - start date/time of the current position (DayPilot.Date object)
  • args.what - what was resized ("start" | "end") - since 2019.2.3823

Notes

The shadow start and end can be changed in the event handler (args.start, args.end, args.multiresize[].start, args.multiresize[].end).

Example

External message

dp.onEventResizing = function(args) {
  $("#msg").html(args.start + " " + args.end + " " + args.duration);
};

Inline message

dp.onEventResizing = function(args) {

  if (args.duration.totalHours() > 4) {
      args.left.enabled = false;
      args.right.enabled = true;
      args.right.html = "The event cannot take more than 4 hours";

      args.allowed = false;
  }
};