Disable days in the popup calendar of Scheduler

4 posts, 0 answers
  1. Ken
    Ken avatar
    2 posts
    Member since:
    Oct 2017

    Posted 10 Oct 2017 Link to this post

    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

  2. Tyler
    Tyler avatar
    68 posts
    Member since:
    Feb 2017

    Posted 10 Oct 2017 in reply to Ken Link to this post

    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.

  3. Nencho
    Admin
    Nencho avatar
    1871 posts

    Posted 12 Oct 2017 Link to this post

    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.
  4. Ken
    Ken avatar
    2 posts
    Member since:
    Oct 2017

    Posted 12 Oct 2017 in reply to Tyler Link to this post

    Thanks

    Worked perfect... 

Back to Top