This is a migrated thread and some comments may be shown as answers.

How can we change the background color the specific time slot range?

1 Answer 280 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Veteran
Jay asked on 22 Oct 2020, 10:51 AM

In the telerik scheduler, how can we set the background color for a specific time range, for example 8AM-11AM for Monday and 10AM-3PM Tuesday etc.

I know we can override the time slot with the TimeSlotTemplateDirective, however, this does not have access to the current resource, it have access to all the resources, and on top of this is we cannot specific the time range? 

Is there any example can be provided to help achieving this? And how about if we are grouping by resources? Is it behavior possible as well?

Thanks

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 26 Oct 2020, 08:58 AM

Hi Jay,

Thank you for the provided details and screenshot.

Styling slots conditionally can be achieved using the slotClass input property of the Scheduler. It accepts a callback which receives an argument of type SlotClassArgs based on which it is possible to determine what CSS class to be assigned to the corresponding time slot. The functionality is applicable when using grouped resources as well. I hope it helps. Please let me know in case any further information is required for this case. Thank you.

Regards,
Svetlin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Mike
Top achievements
Rank 1
commented on 02 Jul 2021, 02:52 PM | edited

No this doesn't help at all. How do we do it? Spent two days on this thus far, should be simple to show us ..

public getSlotClass = (args: SlotClassArgs) => {
return {
background:"purple" // ???????????????????????????????????
};
}
Tags
Scheduler
Asked by
Jay
Top achievements
Rank 1
Veteran
Answers by
Svet
Telerik team
Share this question
or