【发布时间】:2012-12-17 16:40:24
【问题描述】:
<select id="Test" TestAttr="{{:LocationId}}">
{{for #parent.parent.data.Location}}
<option value="{{:LocationId}}" {{if LocationId= *#parent.parent.data.LocationId*}}selected{{/if}}>{{:#parent.parent.data.LocationId}}</option>
{{/for}}
</select>
如何在**之间提到的if语句中获取父数组的LocationId。
【问题讨论】:
-
如果我在选项标签中给出 {{:#parent.parent.data.LocationId}} 我能够看到它的价值。但我想在 if 语句中使用相同的内容。
-
Location 是具有要创建下拉列表的值的子数组。
标签: jsrender