0
我有一个foreach挖空循环,我想在每个复选框中为我的observable在循环中创建的名称设置id。引用自定义html id的基因敲除可观察
<tbody data-bind="foreach: FormatVendorRules">
<tr class="h4">
<td data-bind="text: SubCategoryCode"></td>
<td>
<div class="onoffswitch">
<input name="validationCheckBox" type="checkbox"
name="onoffswitch" class="onoffswitch-checkbox"
id="myId+"text: SubCategoryCode"" data-bind="checked: IsEnabled" /> //This is where I want to define the id
<label class="onoffswitch-label" for="myId+"text: SubCategoryCode"">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>
</div>
</td>
</tr>
</tbody>
所以ID的应该是
- myIdPrice
- myIdValue
- myIdSku
- ...... ECT
非常好,这工作得很好。 –