After updating the [dataSource], the choices pop-up appears briefly and then hidden

Good morning.
I am using the syncfusion autocomplete.
For needs related to the project I am carrying out, for each character acquired, I make a 'post' to a server, providing (in the body) all the 'partial string' acquired so far, and I receive an array of objects that have a description that matches with the 'partial string' sent. In practice, the logic of the autocomplete resides on the server with which I interface.
Once I have received the array of objects, I would like to use the descriptions received in the autocomplete component of syncfusion.
Then I empty the [dataSource] of the 'autocomplete component' and fill it with the descriptions taken from the array of objects received by the server. The operation seems to work if it were not for the fact that the popup with the list of choices received, is displayed for a moment, but immediately after it is hidden.
What's the problem? Maybe I can't use the 'autocomplete' component in this way?
If it were possible to have a small example of how I can implement this logic I would be really grateful.

5 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team November 12, 2020 11:41 AM UTC

Hi Alfredo, 


Greetings from Syncfusion support. 


We validated the reported requirement. In the filtering event, we suggest that you pass the array of objects returned from the server to the Filter method to update the component. We have created the sample based on the mentioned scenario and attached it below.  Refer the below code, 

  
 
    private async Task OnFiltering(FilteringEventArgs args) 
    { 
        // Passing the typed value to the function 
        var filteredvalue = await ownservice.GetDataAsync(args.Text); 
        var query = new Syncfusion.Blazor.Data.Query().Select(new List<string> { "Tag" }).Where("Tag", "startswith", args.Text, true); 
        // Filter the suggestion list based on the typed value. 
        AutoCompleteObj.Filter(filteredvalue, query); 
    } 


Please find the sample below, 




Please check the above sample and get back to us if you need further assistance. 


Regards, 
Sevvandhi N 




AL Alfredo November 12, 2020 02:35 PM UTC

Good morning.
I saw the example you sent me, but I'm afraid it is related to the blazor platform, while I am using Angular 8.
Can I have an example related to Angular?

Thanks for collaboration


BC Berly Christopher Syncfusion Team November 13, 2020 11:51 AM UTC

Hi Alfredo, 
  
Sorry for the inconvenience caused. 
  
We have prepared the sample in the Angular platform and attached it below. 
  
Regards, 
Berly B.C 


Marked as answer

AL Alfredo November 17, 2020 01:30 PM UTC

OK!
Thank you


SP Sureshkumar P Syncfusion Team November 18, 2020 05:50 AM UTC

Hi Alfredo, 
 
Thanks for your update, please get back if you need any further assistance on this. 
 
Regards, 
Sureshkumar P 


Loader.
Up arrow icon