ganttObject.reRenderChart(ej.Gantt.ScheduleHeaderType.Day) ---- redraws but looses custom toolbar ?


Added some custom buttons to the toolbar to change the viewing scale, but after the rerenderchart the chart redraws correctly BUT it looses the custom buttons?

attached code (cut and pasted from various online samples)


Help is appreciated.

Attachment: code_e8c75c1d.zip

3 Replies

JR John Rajaram Syncfusion Team March 7, 2018 12:19 PM UTC

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 



SC Stuart Collier March 7, 2018 12:54 PM UTC

PERFECT !


BM Bharath Marimuthu Syncfusion Team March 8, 2018 05:53 AM UTC

 
Hi Stuart, 
 
We are glad that your requirement has been achieved. 
 
Regards, 
Bharath. 


Loader.
Up arrow icon