I keep getting Gantt control as undefined, this control is inside a Tab control.
I am using similar control without tab and it works fine!!
I am using tabs control, it is in 2nd tab
|
export class AppComponent {
public data: object[];
public data1: object[];
public taskSettings: object;
public toolbar: any;
@ViewChild('place')
public placeObj: DropDownListComponent;
@ViewChild('styles')
public styleObj: DropDownListComponent;
@ViewChild('orientationTab')
public tabObj: TabComponent;
@ViewChild('gantt') gantt: GanttComponent;
constructor() {}
public ngOnInit(): void {
this.taskSettings = {
id: 'TaskID',
name: 'TaskName',
startDate: 'StartDate',
endDate: 'EndDate',
duration: 'Duration',
dependency: 'Predecessor',
progress: 'Progress',
resourceInfo: 'resources',
work: 'work',
child: 'subtasks'
};
}
toolbarClick(args: any): void {
if (args.item.id === 'multitaskbar1_pdfexport') {
this.gantt.pdfExport();
} else if (args.item.id === 'multitaskbar1_excelexport') {
this.gantt.excelExport();
} else if (args.item.id === 'multitaskbar1_csvexport') {
this.gantt.csvExport();
}
}
}
|
Hi
I dont have issues with
toolbarClick
My only issue is when the gantt chart in tab control(2nd tab)
I am not able to access gantt object reference(says undefined) from
@ViewChild('gantt') gantt: GanttComponent;