Check whether current AutoComplete value is in suggestions

5 posts, 1 answers
  1. Josh
    Josh avatar
    72 posts
    Member since:
    Jun 2013

    Posted 14 Nov 2013 Link to this post

    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.
  2. Answer
    Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 18 Nov 2013 Link to this post

    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!
  3. Josh
    Josh avatar
    72 posts
    Member since:
    Jun 2013

    Posted 18 Nov 2013 Link to this post

    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.
  4. Nigel
    Nigel avatar
    8 posts
    Member since:
    Nov 2016

    Posted 04 May in reply to Josh Link to this post

    Yes even I would love this feature, but @Josh your link is not opening for voting
  5. Nencho
    Admin
    Nencho avatar
    1561 posts

    Posted 09 May Link to this post

    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 visualization (charts) and form elements.
Back to Top