当在{{#each}}中使用Ember.select时,如果我在一个选择中选择选项,它将显示它在所有其他选择中被选中。以下是代码和屏幕截图。在循环中选择,选择单个,显示多个选择
代码模板:
{在model.feeddefinitions {#each饲料}}
{{#if isEditing}}
<td> {{view Ember.Select
content=model.sections
optionValuePath="content.id"
optionLabelPath="content.name"
prompt="Select Section"
value=selectedSection}}</td>
<td>
<button class="btn btn-primary btn-sm" {{action 'add_section_to_feed' model feed.id}}>Add</button>
</td>
{{/if}}
</tr>
{{/each}}
将代码放在余烬JS斌,我会帮助你。 – Ajey 2014-12-04 07:14:16
http://jsbin.com/celefokoxi/1/edit我尽可能地添加了代码。 – plzdontkillme 2014-12-05 19:35:57