search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Resize a calendar event from JavaScript

Asked by Matt
16 years ago.
I want to resize an existing calendar event from JavaScript. The resize will be triggered by the user selecting the new start or end time from a pair of dropdown boxes. I already have a JS method that handles this event from the calendar, but I want to be able to call that function myself. My problem is how to instantiate and populate a DayPilotCalendar.Event object on the client side, as the start and end properties are only exposed as getter methods.

So I think what I'm looking for is something like this:
var e = new DayPilotCalendar.Event();
e.setStart(oldStartDate);
e.setEnd(oldEndDate);
rangeResized(e, newStartDate, newEndDate); // My existing resize event handling method, which invokes the CallBack functionality

Thanks,
Matt
Comment posted by Dan Letecky
16 years ago.
It's not quite ready for such scenario at the moment. I would like to upgrade the Event class into a regular class that can be used from the user code in one of the future releases.

But you can use the following workaround:

var e = new DayPilot.Event(id);

DayPilot.Event is declared in Common.js. This will not provide correct values in OldStart and OldEnd in the server-side EventResize handler but the event id (Value) will be passed properly.
Answer posted by Dan Letecky [DayPilot]
12 years ago.

It's now possible to modify the events on the client side and send the update to the server using the Notify model:

http://www.daypilot.org/scheduler-client-side-event-operations.html

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.