The dispose() method destroys the JavaScript Gantt Chart component, removes the content of the placeholder <div>, unbinds DOM events, and cleans up the DayPilot.Gantt object so it can be garbage-collected.
DayPilot.Gantt.dispose()This method has no parameters.
After calling dispose(), the DayPilot.Gantt object becomes unusable.
const gantt = new DayPilot.Gantt("dp", {
// ...
});
gantt.init();
// ...
gantt.dispose();