-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Ember.Select doesn't update selection when the data has been changed #9369
Comments
I believe this is an Ember-Data issues with promise proxies and select. @4eshircat I expect if you simplify the example to not have promises involved select will work as expected. This should probably be an issue at Ember-Data unless you can simplify the example down to not use ED. Please use strings for ids in Ember-Data at all times. |
@mixonic Thank you very much for your answer) |
@mixonic any ideas how it can be achieved with ember-data models? |
Using @4eshircat's example, you could bind directly to the PromiseObject's {{view Ember.Select
content=cities
optionValuePath="content.id"
optionLabelPath="content.name"
selection=model.city.content}} |
@jasonmit man, it's really simple and awesome! Thank you! |
@jasonmit yes that looks like the work around for today. Ember select needs to work correctly with this. I will likely be removing promise proxies in favour of make raw promises bindable but I believe that still leaves select in the same situation. So likely as part of that project I will see if select can be fixed |
I made http://emberjs.jsbin.com/rwjblue/43/edit to handle async a bit better and to send an action on selection change (instead of using two way binding to some outside value). Closing this in favor of the meta issue: #5259. |
This is my jsbin http://jsbin.com/bidoma/8/
There are two users, next to the name of each there is a link "Edit" which opens an edit form. In the form there are text inputs and selects with the names of cities and types. If I choose to edit the item in the entire form perfectly substituted data and shows the current city and type in select. But when I then click on the edit link of another item selects remains with the previous city and type.
Also when I save changes and again trying to edit this item changed fields discard changes.
Waiting for answer. Thank you)
The text was updated successfully, but these errors were encountered: