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

No scheduler-color-mark in AgendaView when EventTemplate is used

1 Answer 140 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
loi
Top achievements
Rank 1
loi asked on 03 Oct 2013, 05:25 PM
We have a scheduler similar to your scheduler/resources demo (http://demos.kendoui.com/web/scheduler/resources.html).
If we configure our scheduler to use an eventTemplate, the color-coded-square would not show in the AgendaView... We need this color-coded-square to show on the Agenda view, is there a way to do this?

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 07 Oct 2013, 06:45 AM
Hello Loi,

The "color-coded-square" is part of the Agenda view's event template, therefore in order to appear you should included in your custom template. The actual color is read form the first's resource configuration. Similar to the following:

<script id="event-template" type="text/x-kendo-template">
    <!--..-->
</script>   
 
<script id="agenda-event-template" type="text/x-kendo-template">   
  <div class="movie-template">       

      <p>
       #if (resources[0]) {#
        <span class="k-scheduler-mark" style="background-color:#=resources[0].color#"></span>
       #}#
     
        #: kendo.toString(start, "hh:mm") # - #: kendo.toString(end, "hh:mm") #
      </p>
      <h3>#: title #</h3>
  </div>
</script>
 
<script>
  $(function() {
    $("#scheduler").kendoScheduler({
        views: ["day", { type: "agenda", eventTemplate: $("#agenda-event-template").html() }],         
        eventTemplate: $("#event-template").html(),       
        resources: [
            //..
        ],
        dataSource: [/*...*/]
        //...
    });
  });
</script>

Regards,
Rosen
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
loi
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or