-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functionality to clear all items. #66
Comments
Hi Asad, ok I see, but aren't the users able to delete these by themselves with the trash icon beside each entry? And at what condition do you clear the selected items if the user is able to select multiple or a single one? The selected items list is set inside the isolated scope of the autocomplete component and cannot be changed from the outside by now. So you would just want a new button which clears all the selected items or do you want to have access to them from the outside? Thanks and regards, Guy |
Hi guylabs, The users will be able to delete by themselves, but i don't want to rely on them for some scenarios. So having access to them from outside will be super helpful. I was planning to have a $watch on the ngModel within your directive, so that if i clear the value, the directive can just clear the selected items. If i get enough time, i might send you a pull request for it. Thanks and regards, Asad |
Hi Asad, I just updated the master with a new attribute called I hope this solves your issues. Can you please test it and come back to me such that I can close the issue? Thanks and regards, Guy |
Hi, any news on this? I want to release 0.3.1 asap such that all can update to a proper version. ;) Thanks and regards, Guy |
Hi Guy, Sorry for not turning back quick. I tried upgrading to the latest version Thanks & Best Regards, On Fri, Sep 18, 2015 at 12:25 AM, Guy Brand [email protected]
|
Hi Guy, I am afraid, i am not able to make it work. I added a binding to the selected-items attribute and tried clearing it by assigning an empty array to it. Yet, the popup shows old selected values. I am not sure what am i missing here. following is how i set it up:
and the controller has:
Best, |
Hi Asad, ok strange. Could you maybe create a reproducible codepen where I can see the issue? Thanks and sorry for my late response, Guy |
Hi Asad, could you maybe have a look at my last commit for this issue and check the https://github.com/guylabs/ion-autocomplete#external-model documentation and try it again? The Thanks and regards, Guy |
Hi Guy, I am trying to create a code pen to show my problem . But i have no idea whats going on. Could you help me with this? Regards, On Tue, Oct 13, 2015 at 9:50 AM, Guy Brand [email protected] wrote:
|
Hi Asad, can you please try the https://github.com/guylabs/ion-autocomplete/blob/master/test/e2e/ion-autocomplete.prepopulated.e2e.html from the master? Just clone the repository and then open the Can you please verify and give me feedback? Thanks and regards, Guy |
Thanks Guy, The external model attribute worked for me. :) But i was wondering why not club the external-model and ngModel together? Regards, On Fri, Oct 16, 2015 at 8:52 AM, Guy Brand [email protected] wrote:
|
Hi Asad, ok nice. Then I will close the issue now. The thing is that the logic how I select the items etc. wont work with the Thanks and regards, Guy |
I would like to clear all my items programmatically. Please find below my current use case.
I have drop down with list of countries.
Based on the countries, i query and show results in the ion-autocomplete. Incase a user has selected multiple options and then wishes to change the country, i would like to clear the selected items.
I tired clearing the items from the bound model (ngModel). Although it clears the text from the readonly input, the autocomplete still shows the selected items.
The text was updated successfully, but these errors were encountered: