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

allow to add events for selected days of the every weeks

1 Answer 36 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kurt Fough
Top achievements
Rank 2
Kurt Fough asked on 01 Dec 2014, 07:25 PM
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.

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 03 Dec 2014, 12:13 PM
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!
 
Tags
Scheduler
Asked by
Kurt Fough
Top achievements
Rank 2
Answers by
Vladimir Iliev
Telerik team
Share this question
or