Kenneth
unread,Mar 5, 2011, 4:10:37 AM3/5/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to KnockoutJS
Hi
My serialized model is (NewtonSoft):
[{Amount":1.11,"Date":"18-02-2011","Units":29.11}]
I bind to to template:
<script type="text/html" id="expenseRowTemplate">
<tr>
<td><input type="text" data-bind="value: Units, uniqueName:
true" class="number" /></td>
<td><input type="text" data-bind="value: Amount, uniqueName:
true" class="number" /></td>
</tr>
</script>
with:
<tbody data-bind="template: { name: 'expenseRowTemplate', foreach:
expenses }">
</tbody>
Problem is when I change for example the Units value, and console.logs
the model, it becomes:
[{Amount":1.11,"Date":"18-02-2011","Units":"29.11"}]
Note the " around the results. And when I post that to server, it
fails, because it's now a string instead of float.
Any Suggestions?
Ken