當在{{#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