AutoComplete Selected Event

Hello. I am testing auto complete and I want to know if this is possible when selecting the autocomplete then I do some call to my controller. I already read it in here but still can't figuring out how to do it. I can bind the data successfully.

1 Reply 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team April 28, 2021 03:30 PM UTC

Hello Albilaga, 

Thanks for contacting Syncfusion support. 

We checked your query. We would like to know you that whenever a value gets selected from the popup, select event will be triggered and you can perform the desired operation inside this callback. Also, whenever Autocomplete’s value gets changed, change event would trigger. We made sample which demonstrates the above events. Please find the sample in the below link.  


Code Snippet     :  

<ejs-autocomplete id="City" 
                      select="onSelect" 
                      change="onChange" 
                      placeholder="Choose countries"> 
        <e-data-manager adaptor="UrlAdaptor" url="/Home/UrlDatasource" crossDomain="true"></e-data-manager> 
        <e-autocomplete-fields text="ShipCountry" value="ShipCountry"></e-autocomplete-fields> 
    </ejs-autocomplete> 



    <script> 
 
        function onSelect(args) { 
            document.getElementById('select').innerText = args.itemData.ShipCountry; 
        } 
        function onChange(args) { 
            document.getElementById('change').innerText = args.value; 
        } 
 
    </script> 


Screenshot        :  

 

Kindly integrate the provided solution with your application and get back to us if you need any further assistance on this. 

Thanks, 
Jeyanth. 


Marked as answer
Loader.
Up arrow icon