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

Scheduler eventTemplate customisation is more flexible than documented

1 Answer 93 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Geoff
Top achievements
Rank 1
Geoff asked on 04 Nov 2016, 02:53 PM

This may be helpful to others. Scheduler's eventTemplate is more flexible than is currently documented. 

The documentation indicates that the following fields may be used:

  • description String - the event description
  • end Date - the event end date
  • resources Array - the event resources
  • start Date - the event start date
  • title String - the event title

Ref: http://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler#configuration-eventTemplate

However, this is not strictly true. I have been able to use any property from a dataSource in the "read" transport. 

Example:

 

 

01.jQuery(function($) {
02.    $("#scheduler").kendoScheduler({
03.        // ...
04.        eventTemplate: $("#event-template").html(),
05.        dataSource: [{
06.            id: 1,
07.            start: new Date("2013/6/6 08:00 AM"),
08.            end: new Date("2013/6/6 09:00 AM"),
09.            title: "Interview",
10.            resources: [1,2],
11.            customField1: "Hello Worlrd!"
12.        } ],
13.        // ...
14.    });
15.});

 

The customField1 (line 11 above) property should actually be available for you to use within your eventTemplate.

1.<script id="event-template" type="text/x-kendo-template">
2.    <span class="title">#: title #</span><br />
3.    <span class="description">#: customField1 #</span>
4.</script>

 

This opens up the eventTemplate to much greater levels of customisation than is documented. 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 08 Nov 2016, 12:27 PM
Hello Geoff,

Thank you for sharing this information with the community. I am sure it will be helpful to the other members, in case they want relate and display additional information in the events.

Regards,
Ivan Danchev
Telerik by Progress
 
Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
 
Tags
Scheduler
Asked by
Geoff
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or