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!