0
如何通過foreach實例作爲方法參數?如何通過foreach實例作爲方法參數?
在下面的代碼中,我如何將每個實例currentFeature
傳遞給$root.enableDemote(currentFeature)
。將它作爲$root.enableDemote(currentFeature)
傳遞不起作用。任何sugegstions?
<tbody data-bind="foreach: { data: features, as: 'currentFeature' }">
<tr>
<td style="width: 8px;">
<button type="button" id="exposureDetailDemoteButton" class="btn btn-default fe-margin" data-bind="click: $root.demoteExposure, enable: $root.enableDemote(currentFeature)" data-toggle="tooltip" title="Demote Feature Exposure"><span class="glyphicon glyphicon-backward"></span></button>
</td>
</tr>
</tbody>
完美。 st.fwd – 2015-02-12 07:23:19
非常感謝你:) – TSV 2015-02-12 07:33:46