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
close icon

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.


Regards,
Sonam Diwate

6 Replies

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

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. 
 
Regards, 
Karthi 



SD Sonam Diwate March 23, 2019 05:13 AM UTC

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 .


Regards,
Sonam Diwate


SD Sonam Diwate March 27, 2019 07:14 AM UTC

Can anyone please help me on this issue?


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

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. 
 
Regards, 
Karthi 
 



SD Sonam Diwate March 27, 2019 10:57 AM UTC

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 04:56 PM UTC

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. 



Property 
Existing Code 
Suggested Workaround 

selectedDate 


<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 


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


group={this.grp} 




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

Regards, 
Hareesh B 


Loader.
Live Chat Icon For mobile
Up arrow icon