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

Views and templates in Kendo SPA

1 Answer 13 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Walid
Top achievements
Rank 1
Walid asked on 06 Jul 2015, 01:36 PM
Hi, 

When working with Kendo SPA, what are the reasons(if any) for views in app to always include HTML content for them as part of Kendo templates?  

- Following sample below: 
<script id="index" type="text/x-kendo-template">
    <span>Hello World!</span>
</script>

 

<script>
var index = new kendo.View('index');
</script>

 Is there any implication (maybe at DOM level) making more suitable to always include HTML view content within <script>?

Since it is possible to define views in my Kendo SPA app without making use of Kendo templates as follows...:

<div id="index">
<span>Hello World!</span>
</div>
 
<script>
var index = new kendo.View("#index");
</script>

 ...I was basically wondering about advantages/disadvantages from using one approach or another.

Thanks, 
Walid

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 06 Jul 2015, 01:56 PM
Hello,

The only real difference here is that the templates are injected and parsed in the DOM on demand. Using DOM elements also works fine, though. 

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