Hi Stuart,
Thank you for contacting Syncfusion support.
We suggest you to change the schedule mode for Gantt control by using “scheduleHeaderSettings” SetModel option. Also this will maintain the CSS for Gantt’s toolbar buttons. Please find the following updated code snippets for your sample.
Code snippets:
|
//...
if (args === "Week") {
//...
//ganttObject.model.scheduleHeaderSettings.scheduleHeaderType = ej.Gantt.ScheduleHeaderType.Week;
ganttObject.setModel({ "scheduleHeaderSettings": { scheduleHeaderType: ej.Gantt.ScheduleHeaderType.Week } });
}
if (args === "Day") {
//...
//ganttObject.model.scheduleHeaderSettings.scheduleHeaderType = ej.Gantt.ScheduleHeaderType.Day;
ganttObject.setModel({ "scheduleHeaderSettings": { scheduleHeaderType: ej.Gantt.ScheduleHeaderType.Day } } );
}
if (args === "Month") {
//...
//ganttObject.model.scheduleHeaderSettings.scheduleHeaderType = ej.Gantt.ScheduleHeaderType.Month;
ganttObject.setModel({ "scheduleHeaderSettings": { scheduleHeaderType: ej.Gantt.ScheduleHeaderType.Month } });
}
if (args === "Year") {
//...
//ganttObject.model.scheduleHeaderSettings.scheduleHeaderType = ej.Gantt.ScheduleHeaderType.Year;
ganttObject.setModel({ "scheduleHeaderSettings": { scheduleHeaderType: ej.Gantt.ScheduleHeaderType.Year } });
}
|
We have also modified the sample with the updated code snippets. Please find the sample in the following location.
Let us know if you need further assistance on this.
Regards,
John R