Scheduler / ViewsDirective Not Responding to Dynamic Changes to startHour

I'm creating a scheduler that depending on what options the user selects, the start hours on the scheduler may be different.

I have noticed though that the when I change the startHour the scheduler doesn't recognize those changes and simply displays the inital startHour when it loaded.

I forked another sample you provided (thank you for that help) and in that example you can see the startHour changes, but not scheduler doesn't update to reflect that change:

https://stackblitz.com/edit/react-scheduler-events-rendered-using-state-s8ovfx?file=index.js

If startHour doesn't support being dynamically changed, is there a way to sort of "kick" the scheduler to rerender if we change something and it doesn't recognize the change?

Thank you.

1 Reply 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team April 9, 2021 03:06 PM UTC

Hi Mark, 

Greetings from Syncfusion support. 

We have validated your reported query “Scheduler / ViewsDirective Not Responding to Dynamic Changes to startHour” at our end and the view options used with the ViewDirective are not supports the dynamic changes. The properties used on the root element of the Schedule only support the dynamic changes. If you want to make the Schedule rerender once the view options are changed we need to refresh the Schedule by using the refresh method of Schedule for the same, we have prepared a sample which can be available from the below link. 

 
[index.js] 
  componentDidMount() { 
    let that = this; 
    setTimeout(() => { 
      that.setState({ startHour: "13:00" }); 
      setTimeout(() => { 
        this.scheduleObj.refresh(); 
      }, 100); 
    }, 4000); 
  } 

Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 


Marked as answer
Loader.
Up arrow icon