Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Problem with the Autocomplete Component
posted

I am running into multiple issues with the sample of your AutoComplete control. 

a) I made some changes to my back end to accommodate same query as you used in sample just a bit more flexible so it can be reused . After doing so i am seeing a problem when the user enters a value which does not return any data like www. The spinner comes on and after some time shows no Data was found as expected. if i click the X while the No Data Found is still showing the spinner goes in an infinite loop. If i wait or click till the No data found message is gone, I can click the X and it clears the box without spinner. The option is to return nothing or to reyrn all data unfiltered and if i return nothing i get the No records found over and over or the whole list ? What does the control expect ? 

b) What do i need to do to load the additional matches if there is more then the set 20? it always will only load the 20 and not send a request to load additional records ?

Here is a StackBlitz witch shows the issues Stack Blitz Sample

Parents Reply
  • 1320
    Offline posted in reply to Alex P

    Hello, Alex,

    I believe you are using the following demo, presented in our samples browser. Please, correct me if I’m wrong.

    The demo above is demonstrating only remote filtering, and does not implement loading data on demand, which I assume, you are expecting when having more than 20 records filtered. Can you please verify that you are looking for a way to initially load 20 matching results and afterwards, when scrolling, load the rest of the results on demand? This can be achieved by using virtual `igx-drop-down`. Here is a sample demonstrating it. What needs to be done is to use autocomplete with virtual drop down. In that case we will have both filtering and loading data remotely. I’ve already started implementing this and will send the solution when I’m ready. Please confirm that this is what you are also expecting and if such a sample will be useful for you.

    When looking at the service that is implemented in the following demo (specifically the ‘buildUrl’ method), no matter what the input value is, when the clear button is pressed, then the value will be empty string and no filter condition will be added in the request to the API service (`searchText` parameter). I will ask you to clarify, what is the difference in the  behavior on your side. Thank you in advance for the cooperation! 

    What I’ve noticed in your source code is that when you are filtering the autocomplete and building your URL in the service, then for example when you are filtering with ‘www’ the URL to the service is: https://nodejs.pub.pgtel.net/api/autocomplete/zip/city/www?skip=0&top=40&count=true

    I believe you are aware that the service is not returning data, when filtered in that way. The same is valid when you want to load all the records (when `top` parameter is not presented): https://nodejs.pub.pgtel.net/api/autocomplete/zip/city/?skip=0&count=true . Those are things that needs to be addressed by the API service. 

    I hope my answer will be helpful for you!

    Regards,

    Monika Kirkova,

    Infragistics

Children