【发布时间】:2017-03-08 05:44:32
【问题描述】:
我正在帮助使用多列表。在帮助器中,您可以指定要显示的对象列以及嵌套的每个循环,它应该都可以工作。我有我需要的值,但我无法让把手使用内部字符串值作为外部值的键。
我有一个几乎可以使用的PLNKR here with all the code in it.,您可以随意使用它。
它几乎可以工作..
我遇到问题的代码的简短部分是:
<table>
{{#items}}
<tr >
{{#each ../colNames}}
<td>{{../this}}.{{this}}</td>
{{/each}}
<td>
<input type="checkbox"
id="masterList{{@index}}"
{{#if this.selected}}checked{{/if}}
onchange="{{../checkAction}}({{@index}})"
>
</td>
</tr>
{{/items}}
</table>
更具体地说:
<td>{{../this}}.{{this}}</td>
我尝试过类似的方法:
<td>{{../this}}.[{{this}}]</td>
<td>{{../this}}.[this]}}</td>
<td>{{../this.this}}</td>
<td>{{../this.(this)}}</td>
我得到的最接近的返回是(将列名称赋予帮助器“名称”和“分数”):
<td>[object Object].name</td>
<td>[object Object].score</td>
提前感谢您提供解决或解决此问题的任何想法。
【问题讨论】: