Autocomplete with multiple dataTextField

Alberto

Hello,
I need to set a multiple dataTextField property on an autocomplete, because I need the suggestion only on certain properties of the objects contained in the datasource.
I've seen that the dataTextField property accept only a string and not an array of strings.
There is another property to obtain what i need? Or a workaround?

Jeffrey

Here is my solution. You can add a new property which contains values from multiple properties, like the textForSearch property in below:

functioncodePage(code, name) {

this.codePage= code;

this.name = name;

this.textForSearch = code + " "+ name;

}

vardata = [

newcodePage("869", "Greek"),

newcodePage("932", "Japanese"),

newcodePage("936", "Simplified Chinese"),

newcodePage("949", "Korea"),

newcodePage("950", "Traditional Chinese")

];

When using kendoAutoComplete, set dataTextField = "textForSearch" and filter = "contains", then you can search multiple fields.
But there is one problem, when suggestion selected from the list, the ugly combined textForSearch property will be filled in the <input>, that is not what we want user to see.

To solve this problem, a good way is to add one more parameter, dataValueField, to assign which property should be filled in the input element. It's easy to implement by modifying kendoAutoComplete._select function: (only one line modified, check the comment)

Luc

Josh

I am having the same issue with my application. Jeffrey's solution worked but we cannot use this as a permanent solution because the changes to the kendo JS file will be overwritten with the next release. We need this functionality for our application to work correctly, can you add it to the next release?

Georgi Krustev

As my collegue mentioned in his last reply, the suggested functionality is still under consideration and we will not be able to implement it for the next official release. We will need to gather more information from the community about it. The best way to do that is to open a uservoice discussion. Thus more people can cast their vote for it.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.