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

Changing the Daypilot instance

Related article: AJAX Scheduler for JavaScript/PHP
Asked by kRaYzie_kAy
2 years ago.

I am looking to change the view of the daypilot chart when an event is triggered. Initially the Scheduler instance is used, but when the event is triggered I want to change this instance into Calendar instance. I am not being able to achieve this by simply changing the value of the variable by creating a new instance. So my question is how can i achieve two or multiple separate Daypilot instances at the click of a button??

Answer posted by kRaYzie_kAy
2 years ago.

I found the solution myself, would be of help to others if ever come across this question.
I simply used the dispose() method of the DayPilot, so when the event is triggered, I first got rid of the existing instance of Daypilot using dp.dispose(), then created the new Daypilot instance, i.e. new DayPilot.Calendar('--id--') and used dp.init(). Worked like a charm!

Comment posted by Dan Letecky [DayPilot]
2 years ago.

Thanks for posting the solution!

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