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

Check whether current AutoComplete value is in suggestions

4 Answers 468 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 14 Nov 2013, 06:03 PM
Hi,

I would like to be able to hook the 'change' event to be able to test whether the current AutoComplete value would be in the suggestions. Since the widget already searched for the value to see if it is in suggestions I would prefer to be able to check the result of that search. Something like calling kendoAutoComplete.search() but not have it affect the UI - just tell me if it was found or not. Is that possible?

I want to be able to alter the UI if the user has entered a value that is not detected in the suggestions to let them know it is not a valid value, and it seems silly to have to manually see if the value is in the datasource (and handle the filter variants 'startsWith' and 'contains') when that is already being done by the widget. So, I'm just looking to detect whether the search done by the widget found the value in suggestions or not.

4 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 18 Nov 2013, 12:09 PM
Hello Joshua,

You cannot do this out-of-the-box and you will need to loop through the dataSource items and see if you find any match manually to whatever is written inside the AutoComplete.

In contrast to the ComboBox widget where you can use the dataItem method (and see if it is different from undefined) or the selectedIndex field and see if it is different from -1.

Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Josh
Top achievements
Rank 1
answered on 18 Nov 2013, 06:56 PM
Bummer. I've added a feature request so that anyone else wanting this behavior can vote for it:
http://feedback.kendoui.com/forums/127393-kendo-ui-feedback/suggestions/5012741-check-whether-current-autocomplete-value-is-in-sug

Thanks.
0
Nigel
Top achievements
Rank 1
answered on 05 May 2017, 03:01 AM
Yes even I would love this feature, but @Josh your link is not opening for voting
0
Nencho
Telerik team
answered on 09 May 2017, 07:11 AM
Hello Joshua,

Please refer to the link below, where the feature suggestion is logged:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/5012741-check-whether-current-autocomplete-value-is-in-sug


Regards,
Nencho
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
AutoComplete
Asked by
Josh
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Josh
Top achievements
Rank 1
Nigel
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or