JvdBerg
JvdBerg

Reputation: 21856

kendo angular autocomplete template

Anyone had any succes on getting a template working with the autocomplete?

I tried the example on the site:

template: '<span class="k-state-default"><img src=\"../../content/web/Customers/#:data.CustomerID#.jpg\" alt=\"#:data.CustomerID#\" /></span>' +
'<span class="k-state-default"><h3>#: data.ContactName #</h3><p>#: data.CompanyName #</p></span>',

and a tried about almost any combination in this:

<input kendo-auto-complete k-data-text-field="'$id'" 
    k-data-source="all_ledger" ng-model="search"
    k-template="'data.name'" >

The syntax for kendo angular seems different on this?

Upvotes: 1

Views: 1880

Answers (1)

JvdBerg
JvdBerg

Reputation: 21856

To answer my own question, the correct syntax is:

<input kendo-auto-complete k-data-text-field="'$id'" 
k-data-source="all_ledger" ng-model="search"
k-template="
'<span style=&quot;display: inline-block; width: 70px;&quot;>${ data.$id }</span>
    <span>${ data.name }</span>'">

Upvotes: 2

Related Questions