I have a list of records, e.g. addresses. It's displayed using the following html5/knockout code.
<section id="lists" data-bind="foreach: addresses, visible: addresses().length > 0">
<article>
<div>
<button>Edit</button>
<span data-bind="text: DisplayAddress"></span>
</div>
<p class="error" data-bind="visible: ErrorMessage, text: ErrorMessage"></p>
</article>
</section>
I want to show a table of editable input boxes () under the row after Edit button is clicked. Is there any way without generate a big html5 code?
I want to show the following editing html below the <div>
after click the Edit button. (not completed)
<div>
<table>
<tr>
<th>Street address</th><th>Apt#</th><th>City</th><th>State</th><th>Zip</th>
</tr>
<tr>
<td><input type="text" class="col1"/></td>
<td><input type="text" class="col2"/></td>
<td><input type="text" class="col3"/></td>
<td><input type="text" class="col4"/></td>
<td><input type="text" class="col5"/></td>
</tr>
</table>
<button data-bind="click: saveAddress">Save</button>
<button data-bind="click: cancelAdding">Cancel</button>
</div>