Set All empty slot to Some custom text in Kendo UI Scheduler

1 Answer 144 Views
Scheduler
Pankaj
Top achievements
Rank 1
Iron
Iron
Pankaj asked on 10 Jun 2023, 08:43 AM

Hi Team

I want to set some custom text ex:- Available , to all empty slots in Scheduler. please tell me how can I Achieve this.

Regards

1 Answer, 1 is accepted

Sort by
1
Accepted
Martin
Telerik team
answered on 14 Jun 2023, 10:57 AM

Hello, Pankaj,

I already answered the question in the support ticket you opened on the same topic, but I will place my reply here as well for other users to see.

You can try the slotTemplate option. Here is a small example for reference.

Regards,
Martin
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 14 Jun 2023, 04:44 PM

Hi Martin

Thanks for your quick response. I have applied it its working nice but problem is that its apply to all empty slots as well as appointment booked slots and another problem is that its not working for month view. 

Regards

Martin
Telerik team
commented on 19 Jun 2023, 10:48 AM

Hello, Pankaj,

Indeed the slotTemplate content will apply for each slot and it will not apply for the slots in the month view as the latter is not supported by the slotTemplate. A possible approach would be to use additional custom logic to check if the current slot is empty, based on the event date, and use the jQuery API to manually update the td element. 

Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 27 Jun 2023, 10:05 AM

Hi

In this scenario, there are multiple time blocks of available to work.
 

The user should just see 1 instance for the entire work day that says 'available to work'.

How Can I Achieve this in slotTemplate.

Regards

Pankaj

Martin
Telerik team
commented on 30 Jun 2023, 08:57 AM

Hello, Pankaj,

If I correctly understand the requirement, 1 instance for the entire work day means the month view again. The only possible approach would be to get all the cells in the month view, and compare with the visible events to check if a slot is empty. If it is, you can use jQuery text method to change the cell content.

Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 30 Jun 2023, 03:22 PM

Hello Martin

This doesn't mean the month view, I want to print only one instance of 'Available to work' for the entire day set instead of repeat after every hours interval. PFA the same

Regards

Pankaj

Martin
Telerik team
commented on 05 Jul 2023, 01:17 PM

Hello, Pankaj, if you need to show "Available to work" only for a specific cell of the Scheduler, you will need to use the correct selector for the element and use the jQuery text method. Let me know if that is what you are looking for. 
Pankaj
Top achievements
Rank 1
Iron
Iron
commented on 05 Jul 2023, 03:06 PM

Hello Martin

please give me some example to Achieve this functionality using jQuery text method.

Regards

Pankaj

Martin
Telerik team
commented on 10 Jul 2023, 10:20 AM

Here is a small example where "Available to work" is displayed in the first Scheduler cell. Let me know if that would work for you.
Tags
Scheduler
Asked by
Pankaj
Top achievements
Rank 1
Iron
Iron
Answers by
Martin
Telerik team
Share this question
or