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

How to move an event programmatically?

Asked by Hoang Phung
10 years ago.

I have a use case where multiple events are linked together in time so that when one is moved or resized, the same operation should be performed on all the other linked events. I have tried dp.update(), dp.events.update() but both are not working. How can I do that? Thanks.

Answer posted by Dan Letecky [DayPilot]
10 years ago.

If you modify the event in .events.list and call update() it should be updated properly (as all events will be redrawn as part of the update).

See also:
http://api.daypilot.org/daypilot-scheduler-update/

Calling dp.events.update() shoud work as well (and it will redraw only this event). You need to use a DayPilot.Event() object that is initialized using the data object from .events.list (the exact instance). You can get such object by calling .events.find(id) or using new DayPilot.Event(dp.events.list[i]);

See also:
http://doc.daypilot.org/scheduler/client-side-event-api/

Let me know if it still doesn't work.

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