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

Disable days in the popup calendar of Scheduler

3 Answers 331 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 10 Oct 2017, 12:41 PM

Issue: Disabling day(s) within the popup calendar in the scheduler

Question: How do you disable days (trying to disable Sundays) in the popup calendar in the Scheduler control. Have been able to disable days in a Calendar control. Cannot not find any sample on show how to implement this functionality in a Scheduler. 

Thanks

Ken

3 Answers, 1 is accepted

Sort by
0
Tyler
Top achievements
Rank 1
answered on 10 Oct 2017, 07:12 PM

This example shows at least one way to get it done (only way I could think of). 

That calendar is a kendo calendar. So you just need to grab it, and get the calendar widget from it, and setOptions({disableDays: [whatever days]}); just like normal kendo calendars.

The trick is getting it... you can't simply get it when you click that link, because it is opening and not available right when you click, thus you will get undefined if you try to grab it. That is why I used the setTimeout. By doing the slightest delay (my example uses 100ms) it is able to grab the calendar widget and set options to disable Sundays, and seems to do so instantly.

 

**Note: depending on what you are doing with this scheduler (I think largely if you are destroying and recreating it at some point), then you may have to rebind that click event on the date navigator in the toolbar, so keep that in mind that your binding of the click event may have to be moved to wherever you create the scheduler so it does it every time the scheduler is created/recreated.

0
Nencho
Telerik team
answered on 12 Oct 2017, 12:24 PM
Hello Tyler,

Your suggestion is absolutely correct. Thank you for sharing it and contributing to the community!

I have updated your Telerik Points on that matter.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Ken
Top achievements
Rank 1
answered on 12 Oct 2017, 12:43 PM

Thanks

Worked perfect... 

Tags
Scheduler
Asked by
Ken
Top achievements
Rank 1
Answers by
Tyler
Top achievements
Rank 1
Nencho
Telerik team
Ken
Top achievements
Rank 1
Share this question
or