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

Using an alternate templating engine

2 Answers 69 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 01 Sep 2015, 10:10 PM

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

Example: 

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

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 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 Sep 2015, 10:07 AM
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.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Charles
Top achievements
Rank 1
answered on 10 Sep 2015, 10:49 AM
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
Tags
Calendar
Asked by
Charles
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Charles
Top achievements
Rank 1
Share this question
or