我已经对这个问题进行了一些研究,但我找不到任何真正有用的东西.
我的问题:
我有一个项目列表(在SharePoint中),我使用KnockoutJS foreach语句显示包含所有这些项目的表.像这样:
数量| 价格| Total_Price | RadioButton1 | RadioButton2
你可以看到有2个单选按钮,必须为它们使用id属性(因为我也使用JqueryUI - label for ='id of element' - )
我试过这样的事情>
代码示例:
.....
<%int i = 1; %>
<! - - ko foreach:Items - > ........Run Code Online (Sandbox Code Playgroud)<input type="radio" id="Yes+<%=i %>"/> <label for="Yes+<%=i %>" >Yes</label> <input type="radio" id="No+<%=i %>" /> <label for="No+<%=i %>">No</label> </td><%I ++; %>
<! - /ko - >
事情是asp代码不能识别ko foreach迭代.
有任何想法吗 ?谢谢