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

call javascript functions inside the for loop in Template

1 Answer 619 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Zareena
Top achievements
Rank 1
Zareena asked on 25 Aug 2015, 06:13 PM

 Is it possible to call a javascript function (formatData) inside the for loop in the template, inside the ## , like below..

 <script id="javascriptTemplate" type="text/x-kendo-template"><ul># for (var i = 0; i < data.length; i++) { #<li>#= formatData(data[i]) #</li># } #</ul></script>

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 27 Aug 2015, 08:55 AM
Hi Zareena,

Yes this is possible. You may find examples in the templates overview help topic (search for 'External Templates and Expressions').

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