styling scheduler

1 Answer 180 Views
Scheduler
Ali
Top achievements
Rank 1
Iron
Ali asked on 18 Aug 2022, 10:35 AM

Hi! Is there any way to add this in schedule grid? Vertical lines for open and closed hours. 


1 Answer, 1 is accepted

Sort by
1
Hetali
Telerik team
answered on 22 Aug 2022, 08:42 PM | edited on 22 Aug 2022, 08:50 PM

Hi Ali,

The custom vertical lines can be added in the Kendo UI Scheduler using the following custom approach:

ngAfterViewInit() {
  var td = document.querySelectorAll(".k-scheduler-table td");
  td.forEach((slot) => {
    var date = new Date(slot.attributes['ng-reflect-invariant-start'].value);

    if(date.getHours() === 4 && date.getMinutes() === 0) {
      slot['style'].borderLeft = '2px solid red';
    }
    if(date.getHours() === 12 && date.getMinutes() === 30) {
      slot['style'].borderLeft = '2px solid green';
    }
  })
}


In this StackBlitz example, I have added vertical lines in the Scheduler using the above discussed approach.

Please note that this custom approach is not officially supported by Telerik and may need further modifications.

I hope this information guides you in the right direction.

Regards,
Hetali
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Scheduler
Asked by
Ali
Top achievements
Rank 1
Iron
Answers by
Hetali
Telerik team
Share this question
or