title: Kendo UI Using template data as a javascript variable
body: <p>I am looking for a way (if there is any) to use data retrieved from the datasource, inside the template, as javascript.</p>
  
  <p>Let me clarify...</p>
  
  <p>In my datasource results i have a variable called <code>ItemType</code>.
  In a template i would use this variable using <code>${ItemType}</code> to 'echo' it in the page.</p>
  
  <p>You can use javascript inside the template by using <code># if (...) { console.log('test') } #</code>.</p>
  
  <p>What i want to achieve, is to use the <code>${ItemType}</code> <em>inside</em> the template's javascript like this:</p>
  
  <pre><code>&lt;script type="text/x-kendo-tmpl" id="dossier_template"&gt;
  # var type= "${ItemType} "; #
  </code></pre>
  
  <p>If i can set a variable depending on the datasource item, i can use if-statements within the rest of the template like this:</p>
  
  <pre><code># if(type == '1') {#
     &lt;div class="type_one"&gt;&lt;/div&gt;
  # else { #
     &lt;div class="type_two"&gt;&lt;/div&gt;
  #
  </code></pre>