title: How to set the scope of `this`on Kendo UI's autocomplete template?
body: <p>Kendo UI's <a href="http://docs.telerik.com/kendo-ui/api/javascript/kendo#methods-template" rel="nofollow">template API</a> lets you use <code>JavaScript</code> in the <code>template</code>. This is useful to customize the <a href="http://docs.telerik.com/kendo-ui/api/javascript/ui/autocomplete#configuration-template" rel="nofollow">autocomplete template</a>. </p>
  
  <p>When the generated code runs, the scope of <code>this</code> is the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window" rel="nofollow">Window object</a>. I want to set the scope to the autocomplete instance, for example, to use the <code>_prev</code> value to customize the results.</p>
  
  <p>On this <a href="http://demos.telerik.com/kendo-ui/autocomplete/template" rel="nofollow">demo code</a>, to change the <code>color</code> of the customer's name to red on the <code>substring</code> equivalent to the search text, you can search for the <code>autocomplete</code> instance  within the <code>template</code> code. On the given sample, just change the <code>template</code> property to</p>
  
  <pre><code> template: 
      '&lt;span class="k-state-default"&gt;&lt;img src= \"../content/web/Customers/#:data.CustomerID#.jpg\" alt=\"#:data.CustomerID#\" /&gt;&lt;/span&gt;' +
      '&lt;span class="k-state-default"&gt;'+
      '# var searchText= $("\\#customers").data("kendoAutoComplete")._prev; #'+
      '# data.coloredName= '+
          '"&lt;span style=\\"color:red;\\"&gt;"  '   +
           '+ data.ContactName.substring(0, searchText.length) +'   +
           '"&lt;/span&gt;" + data.ContactName.substring(searchText.length);  #'+
          '&lt;h3&gt;#= data.coloredName #&lt;/h3&gt;'+
          '&lt;p&gt;#: data.CompanyName #&lt;/p&gt;'+
      '&lt;/span&gt;',
  </code></pre>
  
  <p>However, if I can't use the <code>$()</code> "search", I would want to do it by setting the scope of the function generated by the template. Is it possible?</p>