allow to add events for selected days of the every weeks

2 posts, 0 answers
  1. Kurt Fough
    Kurt Fough avatar
    2 posts
    Member since:
    Oct 2009

    Posted 01 Dec 2014 Link to this post

    Hello,

    I have requirement to allow user that he can add an event on some specific days of calendar. Ex. I am only available on every Monday and Tuesday for whole month. So, user who wants my appointment, can schedule meeting only those 2 days only. all other days will of the calendar will be shown as a grayed. no event can be fired with those days. Is this possible?

    I want to show their color with gray background. so, user can easily identify these cells are not  available for scheduling meeting.

    Please reply ASAP.
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 03 Dec 2014 Link to this post

    Hi Kurt,

    I would suggest to check the following example which demonstrates how you can implement event editing restrictions:
    Also you can use the "dataBound" event to iterate over the current view slots and based on their "startDate" / "endDate" fields to apply custom CSS styles to them:

    dataBound: function(e) {
        var scheduler = this;
        var view = scheduler.view();
     
        view.content.find("td").each(function() {
            var slot = scheduler.slotByElement($(this));
                               //check if current slot should be colored based on your custom logic
            if (slot.startDate % 321 == 0) {
                $(this).css("background", "red");
            }
        })
    },
    Regards,
    Vladimir Iliev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top