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

Personnalize and change view from *.ts

Hello,

I'd like to know how i could change between timelineview (TimelineWeek, timelineDay...) in a ts function, for example : 

this.scheduleObj.activeview.setvalue(timelineDay)
...

And also customize the view, for example for the timelineworkweek to set the work day (monday to friday by default or tuesday to sunday).

Thanks by advance!





1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team July 16, 2019 08:25 AM UTC

Hi Chevron, 
 
Syncfusion greetings. 
 
Scheduler currentView property is two way binding and in the below sample, view is changed based on drop down selection. 
 
 <ejs-schedule #scheduleObj width='100%' height='650px' [selectedDate]="selectedDate" [eventSettings]="eventSettings" [(currentView)]="scheduleView" 
     (eventRendered)="oneventRendered($event)"> 
      <e-views> 
        <e-view option="TimelineDay"></e-view> 
        <e-view option="TimelineWeek"></e-view> 
      </e-views> 
    </ejs-schedule> 
 
<ejs-dropdownlist id="scheduleview" [dataSource]='datas' [(value)]='scheduleView'></ejs-dropdownlist> 
 
In below sample view is changed based on button click action. 
 
btnClick(): void { 
       this.scheduleObj.currentView='TimelineDay'; 
    } 
 
We can customize the views using e-view and kindly refer the below links. 
 
<e-views> 
                <e-view option="TimelineDay"></e-view> 
                <e-view option="TimelineWeek"></e-view> 
                <e-view option="TimelineWorkWeek" [workDays]="workweekDays"></e-view> 
                <e-view option="TimelineMonth"></e-view> 
                <e-view option="Agenda"></e-view> 
            </e-views> 
 
Note: firstDayOfWeek property is used to start the TimelineWorkWeek with Tuesday which will affect all views. We have logged the below improvement report to provide firstDayOfWeek property support on view basis like above workDays property. The fix will be included in our JS2 weekly release on July 30, 2019. 
 
Regards, 
Karthi 


Loader.
Live Chat Icon For mobile
Up arrow icon