Reputation: 3876
I have a list of key value pairs (KVP) and I want to list 2 KVPs in every table row. From my limited Knockout knowledge, I figured that if I have an array of arrays, then I can use a nested foreach
to achieve this.
jsfiddle code here.
But this is not outputting table cells as expected. What is wrong?
edit: updated fiddle link
Upvotes: 1
Views: 405
Reputation: 82654
It's seems I didn't understand your question. However, I'll leave this up in case you were curious how to display the phone numbers.
Also, I add a virtual element.
<!-- ko foreach: phones -->
<td>
<select data-bind="value: type, options: $root.types"></select>
<input data-bind='value: number' />
</td>
<!-- /ko -->
Upvotes: 2