I’m having some trouble figuring out how to get Ember’s select view to update the dom when using objects instead of strings. This example behaves how I would expect:
Using only an array of strings for values, setting the bound property’s value to a new value by clicking the buttons will automatically update the dom and set the dropdown to the same value.
When using objects in this example however:
I tried setting the bound property’s value to the id, value, and a copy of the option object itself, and I can’t get it to affect the select view.
I just need a way to set the value of a select view when using objects for options
I’ve added an other button in your fiddle:
http://jsfiddle.net/Sly7/BYjk6/#base
I think you have to use the same object, but not a copy. So in your case you have to pick up the object from the array bound to the Ember.Select’s content property.
EDIT: jsfiddle using #each and {{action}}. I think it cleans up the template and the code.
http://jsfiddle.net/Sly7/sCr8T/
JavaScript: