-
Notifications
You must be signed in to change notification settings - Fork 45
ui-select not updating after asyncCallback #43
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
Comments
Well, that you do not have an initial titleMap is sort of the point with ASFDS, so that in itself is not a problem. $http.get(options.urlOrWhateverOptionIWant) returns the promise, not the array of data. |
The asyncCallback with promises is implemented properly. The items returned are inserted into the dropdown. But $scope.select_model.selected should be set after the dropdown-data changed. I found a fix and I'll do a PR |
Ok, great! The UI-select implementation is a complicated and quite hard to improve upon due to how ui-select works, so all PR:s in that regards are very appreciated. |
Thanks @eburi for your help on this one. I didn't even properly understand what the problem was until I saw you PR. :-) This means that this issue is resolved in the 0.12.3-release. Closing and thanks again! |
I'm trying to integrate ASFDS into my project with ui-select for autocomplete and the asyncCallback to actually get the data from the server.
I noticed, that the asyncCallback gets called and the results I return, show up in the dropdown. But the filed already has a value and the ui-select will not switch to this value, once that value is in the titleMap (after asyncCallback return the results) instead it always displays the placeholder.
Is there something I can call on the formOptions passed into the asyncCallback?
The problem is, that I don't have an initial titleMap. The ui-select will be populated with values from a REST-Endpoint and initially I can only load the value that field already points to. But when I return that (name,value)-pair form asyncCallback, I get the console message: "asyncCallback items [Object, Object]", where the current value of the field is present, but the ui-select does not change from the placeholder to that value.
I tried this before with starpselect and it was working there. But with the strapselect, I'm missing the possibility for the user to type in something and then lookup values based on this input.
Any ideas?
The text was updated successfully, but these errors were encountered: