We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AutoComplete filters in Value instead of Text

Thread ID:





143372 Mar 17,2019 05:49 PM UTC Mar 19,2019 11:45 AM UTC ASP.NET Core - EJ 2 3
Tags: AutoComplete
Asked On March 17, 2019 05:49 PM UTC

when using the AutoComplete widget with UserIds (GUID) and DisplayNames, the filter appears to work on the Value instead of the DisplayText - which doesn't make a lot of sense.
Sample: https://syncfusion-autocomplete.stackblitz.io
Editor: https://stackblitz.com/edit/syncfusion-autocomplete

Example record:
"UserName": "admin",
"DisplayName": "Admin",
"Id": "f650c4f8-b8df-44ef-b6a8-866de50af211",
"Email": "admin@example.org"

Type: b68a -> displays "Admin"
Type admi -> displays nothing

A filter only really make sense when - at least by default - filters on the text that is displayed instead of the underlying value. Not sure whether this is a bug or a feature?

Prince Oliver [Syncfusion]
Replied On March 18, 2019 07:06 AM UTC

Hi Stefan, 

Thank you for contacting Syncfusion support. 

This not a bug in our AutoComplete control, this is the intended behavior. By default, EJ2 AutoComplete works only with value field for operations like filtering sorting. If you require to filter using the text field, you can customize using the filtering event in the control. Take a moment to look at the following KB document for further reference on this: https://www.syncfusion.com/kb/10158/why-autocomplete-does-not-filter-using-text-field  

Please let us know if you need any further assistance on this. 


Replied On March 18, 2019 09:45 AM UTC

Thank you very much.
I'm not sure if that makes sense, but it is now understood.

You may want to update that KB article to show how to reset the search, that took a while to figure out. Like:
     // if text length < minLength, do nothing and reset datasource
            if (e.text.length < e.updateData.length) {
                e.cancel = true;
                return false;
            // code to search etc.   

Prince Oliver [Syncfusion]
Replied On March 19, 2019 11:45 AM UTC

Hi Stefan, 

Thank you for your valuable feedback on the KB article. We will consider this in our end and update the content soon. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon