Autocomplete with json array

2 posts, 0 answers
  1. yceron
    yceron avatar
    21 posts
    Member since:
    Apr 2007

    Posted 23 Oct 2015 Link to this post

    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.

  2. yceron
    yceron avatar
    21 posts
    Member since:
    Apr 2007

    Posted 25 Oct 2015 in reply to yceron Link to this post

    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.

     

  3. Kendo UI is VS 2017 Ready
Back to Top