autocomplete showing [object Object] when item selected

2 posts, 0 answers
  1. Drew Auman
    Drew Auman avatar
    17 posts
    Member since:
    Sep 2009

    Posted 05 Apr 2013 Link to this post

    I'm not really sure what is going on here, it's driving me crazy.  I have a template attached to an autocomplete, and this template works correctly when the data is loaded in the drop down.

    It appears that it is ignored when an item is actually selected though, and instead of seeing the item I see the string [object Object] in the input field.  Did I miss something? I know that the data item is selected correctly, as I manipulate it with other page events after it is selected.

    Here is my code:

    http://jsbin.com/opuwav/1/edit
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 09 Apr 2013 Link to this post

    Hello Drew,


    Even though a template is used in the current scenario, you should specify a dataTextField property, which will be displayed in the input when an item is selected. The template is used only to visualize the items in the dropdown list. This is demonstrated in the following demo.

     

    Greetings,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top