Kendo UI loop through collection in Json within template for ListView
You can have arbitrary JavaScript code inside a template:
<script type="text/x-kendo-tmpl" id="template">
<div class="subscriberFunction">
<h3>${Title}</h3>
<!-- Display KeyPairs -->
<ul>
# for (var key in KeyPairs) { #
<li>${ KeyPairs[key] }</li>
# } #
</ul>
</div>
</script>
You can do this with a counter in the for-loop. This should fix your issue:
<script type="text/x-kendo-tmpl" id="template">
<div class="subscriberFunction">
<h3>${Title}</h3>
<!-- Display KeyPairs -->
<ul>
#for (var i=0,len=KeyPairs.length; i<len; i++){#
<li>${ KeyPairs[i] }</li>
# } #
</ul>
</div>
</script>