Destroy Gantt Control
17 Jul 2018 / 1 minute to read
Gantt control is composed with more sub-controls like TreeGrid, Splitter, Dialog etc. So while destroying the Gantt control we need to
remove all sub-control elements and unbind all events bound by this control. By using destroy
public method, we can properly remove the Gantt control from DOM.
The following code example explains how to destroy Gantt control.
<button id="buttonon" (click)="destroy($event, item)">Destroy Gantt</button>
<ej-gantt id="GanttControl">
//...
</ej-gantt>
import {Component} from '@angular/core';
@Component({
selector: 'ej-app',
templateUrl: 'app/app.component.html',
})
export class AppComponent {
constructor() {
//...
}
public destroy(event, item) {
var obj = $("#GanttControl").ejGantt("instance");
obj.destroy();
}
}
NOTE
If you want to re-initialize Gantt control on same
div
element,
we need to perform destroy action before re-initialize the Gantt.
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page