This is a migrated thread and some comments may be shown as answers.

Autocomplete with json array

1 Answer 94 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Yoly
Top achievements
Rank 2
Yoly asked on 23 Oct 2015, 10:56 PM

Hi.

I have a json array that I want to use with autocomplete in order to display a template like in this demo:

http://demos.telerik.com/kendo-ui/autocomplete/template

 

 I have a working and a non-working version of a simple autocomplete in the following jsfiddle.

http://jsfiddle.net/cupnfkhq/​

 

My main problem is the second autocomplete that doesn't work (the one bound to usersData). I have a similar response from a server, in which it returns an array, but I can't seem to get the autocomplete to work. I want to eventually have a custom template for the autocomplete itself.

What am I doing wrong?

 

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Yoly
Top achievements
Rank 2
answered on 25 Oct 2015, 06:04 PM

I figured out what the problem was. I want to leave the answer here in case someone else gets the same problem in the future and gets to this post.

Besides an obvious mistake where I was binding the autocomplete that didn't work to the incorrect data source (I blame copy/paste), the problem was that I was missing the dataTextField property on the configuration. Once I added the dataTextField the configuration, it worked as expected.

 

Tags
AutoComplete
Asked by
Yoly
Top achievements
Rank 2
Answers by
Yoly
Top achievements
Rank 2
Share this question
or