We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

resourceHeaderTemplate get re-render on state change

resourceHeaderTemplate get re-render on state change. Because of this every time it blinks and shows the data.
How to avoid rerending custom template.

Sonam Diwate

6 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team March 21, 2019 12:55 AM

Hi Sonam, 
Thank you for contacting Syncfusion support. 
In the below sample we have changed the state value on button click which will load the events in empty resource Scheduler without any blink. 
If we misunderstood your requirement, kindly share your code example / sample(if possible) to proceed further and check whether your requirement is like below forum. 

SD Sonam Diwate March 22, 2019 09:13 PM

This is working as expected because this example contents static dataSource or static data from json.
Could you please provide same example with data from server.

As we have a structure which calls a action from reducer and update state using getDerivedStateFromProps .

Sonam Diwate

SD Sonam Diwate March 26, 2019 11:14 PM

Can anyone please help me on this issue?

KK Karthigeyan Krishnamurthi Syncfusion Team March 27, 2019 02:48 AM

Hi Sonam, 
Thanks for your update. 
We have modified our previous sample to fetch the data from remote service and Schedule is working correctly. We request you to reproduce the issue in our sample and revert else share your code example / sample (if possible) to proceed further. 

SD Sonam Diwate March 27, 2019 02:57 AM

I have created POC which has external drag and drop example.
and i have added simple state change event, but when we change the state "resourceHeaderTemplate" function get re render again and template data will not shown on the screen.

Could you help me to fix this issue and guide me what wrong I am doing.
Please click on change source button at top left of page to reproduce this issue.

Attachment: schedulingDragDrop_39efa436.zip

HB Hareesh Balasubramanian Syncfusion Team March 28, 2019 08:56 AM

Hi Sonam, 

We have checked your provided code example and could reproduce the reported problem at our end, which was suspected to be due to the “resourceHeaderTemplate” property is not properly handled during the set state changes. Currently, we are validating the scenario further related to this particular template property and therefore, in the mean-time, we suggest you to try our following highlighted code changes (by declaring a variable/property for the selectedDate and group properties and assign those variables to the respective APIs of the ScheduleComponent instead of directly assigning the value) which could also be referred from the below StackBlitz sample.  Also, further information regarding this issue validation will be shared from our side on March 29, 2019. 

Existing Code 
Suggested Workaround 


<ScheduleComponent ref={schedule => this.scheduleObj = schedule} cssClass='schedule-drag-drop' width='100%' height='650px' selectedDate={new Date(2018, 7, 1)} currentView='TimelineDay' resourceHeaderTemplate={this.resourceHeaderTemplate} 

<ScheduleComponent ref={schedule => this.scheduleObj = schedule} cssClass='schedule-drag-drop' width='100%' height='650px' selectedDate={this.date} currentView='TimelineDay' 


group={{ resources: ['Departments', 'Consultants'] }} 


Kindly be patience, until we get back to you with the issue validation information.  

Hareesh B 

Live Chat Icon For mobile
Up arrow icon