I found a good solution for a reusable select view here: select dropdown with ember (the answer by @ebryn)

However, I'm having difficult finding a way to use this for objects that have an id attribute. What I mean is that I want to be able to use the select view for managing associations on persisted object.

I have forked the js fiddle here: http://jsfiddle.net/sohara/rgDQr/13/ Currently there is no way to persist the selections and person attribute of my thingController is set on page load. Is there a good way to change this so that the select manages just the id value, but still display, for instance, the fullName attribute?

I suppose I could add callback in the thingController that sets the personId based off the id value of its person object, but that doesn't solve the issue of persistence. Every page load would then reset the personId attribute. Plus I think it would make sense to target the personId attribute directly from the view if that is the attribute I want to change?

Thanks, Sean

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top