使用Ember.Select,我成功地呈现了我的下拉菜单
{{view Ember.Select
content=businessType.acceptableValues
optionLabelPath="content.name"
optionValuePath="content.value"
prompt=businessType.prompt
}}从模型中提取数据的控制器如下所示:
businessType: function(){
var content = this.get('content');
return content.get(10);
}.property('content')我不知道如何设置选定的值。我尝试过将值设置为content.value,我也尝试过selectionBinding=content.value,但对我来说什么都不起作用。对此我有什么不明白的。
谢谢
发布于 2014-04-28 12:01:48
看看http://emberjs.com/api/classes/Ember.Select.html文档。
上面写着:
Ember.Select中选定的值属性可以绑定到另一个对象上的属性:
通过选择第一个选项('Yehuda')与呈现的元素交互,将更新currentProgrammer的id以匹配新选择的value属性。
因此,您只需将一些现有对象属性绑定到Ember.Select value。
https://stackoverflow.com/questions/23331908
复制相似问题