How to add holidays to kendo scheduler? -


is know how add holidays kendo scheduler?

i mean in holiday user shouldn't able add events.

i suggest add custom class in example created class k-holiday or maybe utilize kendo class k-non-workhour , on databound function add :

databound: function () {     var scheduler = this;     //get scheduler view     var schedulerview = this.view();     //loop through slot/event/tile     schedulerview.table.find("td[role=gridcell]").each(function () {          //find start date         var slot = scheduler.slotbyelement($(this));          var constant_holiday_date = new date("2013/6/11");         constant_holiday_date.sethours(0, 0, 0, 0);         slot.startdate.sethours(0, 0, 0, 0);          //compare date curent event holiday         if (slot.startdate.gettime() == constant_holiday_date.gettime()) {             $(this).addclass("k-holiday");         } else {             $(this).removeclass("k-holiday");          }     }); }, 

i created holiday on particular date new date("2013/6/11") later on event/slot on date have k-holiday class, want add edit function :

edit: function (e) {     var uid = e.container.attr('data-uid');           var element = e.sender.element.find('div.k-event[data-uid="' + uid + '"]');     var slot =$("#scheduler").data("kendoscheduler").slotbyelement(element);     if($(slot.element).hasclass("k-holiday")){         e.preventdefault();     } } 

above condition filter event double clicked / edited , prevent event has k-holiday open popup. please refer kendo dojo

note : on example notice on tuesday 6/11 can't trigger edit/add new event, on day other still can


Comments