Friday, 15 February 2013

javascript - foreach binding for only one element in knockout -



javascript - foreach binding for only one <td> element in knockout -

i using knockout binding in 1 of mvc project.

i want apply foreach binding on single

<table> <thead> <tr> <th>margintype</th> @foreach (var discountgroup in model.customerdiscountgroups) { <th> @discountgroup.code </th> } </tr> </thead> <tbody data-bind="foreach: margintypes"> <tr> <td data-bind="foreach:customerdiscountgroups"> <span data-bind="text:code"> </span> </td> </tr> </tbody>

i want repeat 2nd td no of customerdiscountgroups.

i don't think need each that, nor inner <th>

<tr> <th>margintype</th> <th> @model.customerdiscountgroups.first().code </th> </tr>

javascript jquery asp.net-mvc knockout.js

No comments:

Post a Comment