Scheduler eventTemplate customisation is more flexible than documented

2 posts, 0 answers
  1. Geoff
    Geoff avatar
    1 posts
    Member since:
    Nov 2016

    Posted 04 Nov 2016 Link to this post

    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


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




    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.    });


    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>


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

  2. Ivan Danchev
    Ivan Danchev avatar
    1303 posts

    Posted 08 Nov 2016 Link to this post

    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.

    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.
Back to Top