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

autocomplete showing [object Object] when item selected

1 Answer 575 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Drew Auman
Top achievements
Rank 1
Drew Auman asked on 05 Apr 2013, 04:42 PM
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

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 09 Apr 2013, 07:39 AM
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!
Tags
AutoComplete
Asked by
Drew Auman
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or