-
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
item-value-key vs. item-view-value-key #173
Comments
Hi @rodrigobnn, can you maybe elaborate more on your use case and what exactly you want to achieve? A running example in a codepen would be nice or at least some snippets of the object and how you defined the Thanks and regards, Guy |
Hi @guylabs I save the whole object in my "ng-model" directive, when I type something to filter the option label should show "/home/Java" but once I click it I want to see in the original input field as the result of my selection "Java". The library uses "item-view-value-key" to define the label in the list and what to show in the input after select. What I suggested is to use the value in "item-value-key" to define what will be showed in the input after select the option with "/home/Java".
|
Hi @rodrigobnn, ok so you mean that you want to store the value Well this is not supported currently and I do not see the added value of it. Imagine that the user selects value A and then it converts it to another value when selected. This can confuse the user as the value is not the same as the user selected initially. I think the problem would be solved on your side when issue #28 is implemented as then you can override the render function and have your custom logic there. I hope this is ok for you and I try to add this as soon as possible. Thanks and regards, Guy |
Hi @rodrigobnn, I will close the issue due to inactivity. Please reopen it if there is still an issue. Thanks and regards, Guy |
I made a change so I could show a text in the list and a different in the input after the item had been selected, in ngModelController.$render I changed from itemViewValueKey to itemValueKey, so pretty simple and no hard for other cases.
Would be nice to have an option so I could use different values in a future version.
Thanks for the ion-autocomplete. very nice!
The text was updated successfully, but these errors were encountered: