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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set properties on scheduler

Thread ID:





147845 Sep 25,2019 03:16 PM UTC Sep 27,2019 04:25 AM UTC Angular - EJ 2 4
Tags: Schedule
Jan van Rossum
Asked On September 25, 2019 03:16 PM UTC

From Angular, I want to update the interval property of the schedule component.

I am trying this:
@ViewChild('schedule', { static: false }) public schedule: ScheduleComponent;
this.schedule.setProperties({ interval: value });

But this change is not reflected, even if I do 

When the schedule refreshes after this, the change is successfully reflected.

What is the right way to directly update a property?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On September 26, 2019 07:17 AM UTC

Syncfusion greetings. 
In the below sample, we have changed the Day view interval based on drop down field value. 
public onViewIntervalChange(args: any): void { 
    this.scheduleObj.views = [ 
      { option: 'Day', interval: args.value }]; 

Jan van Rossum
Replied On September 26, 2019 07:53 AM UTC

Hi Karthigeyan,

Thanks for your reply.
After some experimenting I got it working.
I think it's a bit laborious from an Angular point of view...
Also I didn't get it to work without calling .refresh().
In your example that was not necessary, do you have an idea why? 
Can it be caused by the Timeline view?

Here is the code:

In .html:
<ejs-schedule #schedule [views]="views">

In .ts:
@ViewChild('schedule', { static: false }) public schedule: ScheduleComponent;
private getViews(): ViewsModel[] {
return [
option: 'TimelineWeek',
interval: this.interval
views = this.getViews();
_interval = 4;
get interval() {
return this._interval;
set interval(value) {
this._interval = value;
this.schedule.views = this.getViews();

Jan van Rossum
Replied On September 26, 2019 12:18 PM UTC

Found the bug in my implementation, refresh() is not necessary anymore.
Thanks for your help!

Karthigeyan Krishnamurthi [Syncfusion]
Replied On September 27, 2019 04:25 AM UTC

Most welcome 😊 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon