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

Kendo Autocomplete throwing [object Object] when used in grid column editor

3 Answers 211 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Kushan
Top achievements
Rank 1
Kushan asked on 12 Mar 2019, 09:49 AM

I am using kendo grid column editor to get autocomplete values in each cell in a column.

If my selected text is digit, then its selecting [object Object] for the first time and after that if I select again different digit, it will select the digit.

And it doesn't happens with the alphabet/alphanumeric text values.

In the below code, If I am selecting "50", it is giving [object Object].

And if I am selecting Test 65/ Test, it will not change.

And if I add space in text ("50 "), them this value will also not change.

please check and resolve the issue.

 

$('<input data-text-field="text" data-value-field="value" data-bind="value:' + options.field + '"/>')
            .appendTo(container)
            .kendoAutoComplete({
                autoBind: false,
                suggest: true,
                filter: "contains",
                index: 1,
                minLength: 1,
                dataSource: [
                    { text: "50", value: "50"},
                    { text: "60", value: "60" },
                    { text: "Test 65", value: "65" },
                    { text: "Test", value: "23" },
                    { text: "64", value: "64" },
                    { text: "20", value: "20" }
                ]
            });

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Mar 2019, 09:10 AM
Hello Kushan,

In general, the AutoComplete widget works with a single data item field. This means that the selected value is directly set to the model field. Refer to the following HowTo example that demonstrates how to bind the AutoComplete as a Grid editor:


Also, If you would like to work with <value, text> pairs, the recommended approach is to use the ComboBox, DropDownList, or MultiSelect instead of an AutoComplete widget.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Kushan
Top achievements
Rank 1
answered on 14 Mar 2019, 09:19 AM

Hi Dimitar,

Thanks for the reply.

I tried with a single data item field also.

But was facing same problem.

Can you just create a code in dojo and show me if number it will take.

Because I tried and giving me same in single data item field.

0
Dimitar
Telerik team
answered on 14 Mar 2019, 09:42 AM
Hello Kushan,

Can you check the following Dojo example and let me know how that works? 

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
AutoComplete
Asked by
Kushan
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Kushan
Top achievements
Rank 1
Share this question
or