So, suppose I have this web service that returns a C# List serialized to JSON, so what I get back in the client, in the viewmodel, is a JSON array:
[
{"Id": 1, "Name": "John", "Age": 30},
{"Id": 2, "Name": "Mike", "Age": 25},
{"Id": 3, "Name": "Lana", "Age": 28},
]
Although this is not the actual data I'm working with, It'll be sufficient for the example.
What I'm trying to accomplish, by using knockout.js, is to data-bind each element in the above array (viewmodel) to a td tag inside a table in my view. So, in this example:
<table>
<tr>
<td></td> // this would represent John
<td></td> // this would represent Mike
<td></td> // this would represent Lana
</tr>
</table>
Important to notice that don't want just to data-bind an element's property to a td's attribute, like
<td data-bind="text: vm.Name">
I wanted the td tag to, somehow, represent the whole person element (object).