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
非常好,這工作得很好。 –