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

Use pre-compiled template along with MVVM

1 Answer 66 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 08 Nov 2015, 11:05 AM
Hi
I have a view model with some repeating properties that I need to render using the same template.
I specified the template, and bound the viewModel properties using source binding and data-template attribute.

It works well, but according to the kendoUI documentation, pre-compiling and reusing of the template makes sense when it should be rendered several times.

Is there any way to use the advantage of pre-compiled templates along with mvvm (For example, data-template attribute could accept not only the id of the template DOM element, but also model's function name)?
Thanks!

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 11 Nov 2015, 08:46 AM
Hello Pavel,

The data-template attribute should point to the ID of a script element, as mentioned in the source binding documentation. That being said, using compiled templates along with MVVM is not supported.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MVVM
Asked by
Pavel
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or