title: Access data array in Kendo template
body: <p>I have a Kendo mobile view that takes data in the form of a JSON feed, and then displays it using a Kendo template.</p>
  
  <p>I want to create a fairly complex grid out of this JSON feed, and the only way I can think to do that is to wrap certain items in a <code>div</code> with a class name that varies depending on its position in the array.</p>
  
  <p><strong>How can I access the array object inside a Kendo template?</strong></p>
  
  <p><a href="http://docs.telerik.com/kendo-ui/getting-started/framework/templates/overview" rel="nofollow">The docs</a> give this example:</p>
  
  <p>
  
  <blockquote>
    <p>For example, to display a list of items using JavaScript and Kendo UI templates, we use the following syntax:</p>
  </blockquote>
  
  <pre><code>&lt;script id="javascriptTemplate" type="text/x-kendo-template"&gt;
      &lt;ul&gt;
      # for (var i = 0; i &lt; data.length; i++) { #
          &lt;li&gt;#= data[i] #&lt;/li&gt;
      # } #
      &lt;/ul&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>If I do a console.log like this within my template:</p>
  
  <pre><code># console.log(data); #
  </code></pre>
  
  <p>I can see that <code>data</code> does reference the JSON, but it's not usable (<code>data.length</code>) returns undefined, so that example does nothing.</p>