3

Is there a way to customize kendo.Scheduler rows and columns color? If there is, let me know how! How to change these rows color?

UPDATE 1> This is the answer>

     view.table.find("td[role='gridcell']").each(function () {
        if ($(this) != null) {
            var element = $(this);
            if (element != null) {
                var slot = scheduler.slotByElement(element);
                if (slot != null) {
                    var dateSlot = slot.startDate;
                    if ("20/09/2014 14:00"== dateSlot.toString())
                        element.addClass("red");
                }
            }
        }
    });

You have to add the following css too:

.k-scheduler .k-today.red { 
        background: #ff6f7b; /*When the slot is today*/
    }
.red {
        background: #ff6f7b;
    }
.k-scheduler .k-state-selected.red { /*The color when you select the slot*/
        background: #4070B8;
    }
Joan Gerard
  • 135
  • 6
  • 17

1 Answers1

5
function scheduler_dataBound(e) {
      var scheduler = $("#scheduler").data("kendoScheduler"); 
      var view = scheduler.view();
      view.table.find("td[role=gridcell]").each(function () {
      if ($(this) != null) {
         var element = $(this);
         if (element != null) {
              var slot = scheduler.slotByElement(element);
                 if (slot != null)
                     if (slot.startDate, slot.endDate, == "youre times")
                         element.addClass("youre css clas name ");
         }
     }
});
RajeshKdev
  • 6,365
  • 6
  • 58
  • 80
ChrG
  • 141
  • 4
  • BUG Aufpassen beim zerren oder strecken des Schedulers kommt es zu ungewolltem verhalten bei mir in form von streifen des eingefärbten Bereiches, das liegt an der funktion lotByElement(element), intern macht diese ein paar aufrufe von getSlotByPosition die fehlschlagen können. – ChrG Jul 09 '14 at 08:22
  • It works, but when I select an slot it's not blue color as it should be, how can I solve this problem? – Joan Gerard Aug 01 '14 at 21:34
  • Amazing , you saved my day :) – Ahmed Mahmoud Aug 09 '15 at 14:41