Using an alternate templating engine

3 posts, 0 answers
  1. Charles
    Charles avatar
    15 posts
    Member since:
    Dec 2010

    Posted 01 Sep 2015 Link to this post

    I'm wrapping Kendo controls for an application I'm writing in Aurelia.

    I've written wrapper for Kendo Grid which works fine - I've used the "template" property in the grid options which accepts a callback. In this callback I dynamically compile the row template in the context of the row data which allows me to use Aurelia's markup instead of Kendo templates


    <kendo-grid"getTimesheets($event)" sortable.bind="true">
        <kendo-grid-col field="TranDate" heading="Date">
            <kendo-template>${ $item.TranDate | dateFormat }</kendo-template>

    I'm trying to do the same with Calendar. I'd like to be able to provide a function which the calendar control will call when it's rendering the tiles on the Month view.

    Currently the `month` property on Calendar options only seems to accept a JS object which allows a "content" string/kendo template.

    Failing there being a callback, is there some documentation around kendo.template that I can use to write an Aurelia wrapper? I'm trying to dig around in the github repo to find where the kendo.template magic happens - any pointers or advice you could give me would be awesome!

    Thanks in advance

  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 03 Sep 2015 Link to this post

    Hello Charles,

    Currently, the Calendar widget does not support passing a function as a month content/empty template (as you point already). Basically, we build the template directly (more details here) without checking for callbacks.

    One option is to modify the code and start accepting callbacks. The other option is to override the kendo.template and start using different templating engine. I guess that in both cases, you will need to modify the code.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Charles
    Charles avatar
    15 posts
    Member since:
    Dec 2010

    Posted 10 Sep 2015 in reply to Georgi Krustev Link to this post

    I ended up watching the DOM with a mutation observer and handled it that way - it would be nice to plug a hook in though
Back to Top