Note that there are some explanatory texts on larger screens.

plurals
  1. POKnockout mapping does represent wished for html
    text
    copied!<p>I have a problem with knockout mapping. I'm using knockout mapping plugin to represent a form that is serialized in JSON. It was working before using the knockout mapping but I need to use knockout mapping since I want my properties to be observable. </p> <p>You can see the working html here : <a href="http://jsfiddle.net/etiennenoel/wG9SZ" rel="nofollow">http://jsfiddle.net/etiennenoel/wG9SZ</a></p> <p><strong>Here's my not working javascript code:</strong></p> <pre><code>var formData = {"data": [ { "groupName" : "Properties", "content" : [ { "title" : "Calculation Method", "formType" : "select", "value" : [ { "title" : "Voltage Drop - Unbalanced", "selected" : true }, { "title" : "Voltage Drop - Balanced" } ] }, { "title" : "Tolerance (% V)", "formType" : "textBox", "value" : 0.01 }, { "title" : "Calculation Options", "formType" : "radio", "value" : [ { "title" : "Flat Start (at Nominal Conditions", "checked" : false } , { "title" : "Assume Line Transposition", "checked" : true } ] }, { "title" : "Adjust Conductor Resistance at", "formType" : "textBox", "disabled" : true, "value" : 77, "appendLabel" : true, "appendLabelText" : "°F" } ] }, { "groupName" : "Properties", "content" : [ { "title" : "Calculation Method", "formType" : "select", "value" : [ { "title" : "Voltage Drop - Unbalanced", "selected" : true }, { "title" : "Voltage Drop - Balanced" } ] }, { "title" : "Tolerance (% V)", "formType" : "textBox", "value" : 0.01 }, { "title" : "Calculation Options", "formType" : "radio", "value" : [ { "title" : "Flat Start (at Nominal Conditions", "checked" : false } , { "title" : "Assume Line Transposition", "checked" : true } ] }, { "title" : "Adjust Conductor Resistance at", "formType" : "textBox", "disabled" : true, "value" : 77, "appendLabel" : true, "appendLabelText" : "°F" } ] } ] }; ko.mapping.fromJS(formData); </code></pre> <p>Here's the jsfiddle of the same code: <a href="http://jsfiddle.net/etiennenoel/wG9SZ/3/" rel="nofollow">http://jsfiddle.net/etiennenoel/wG9SZ/3/</a></p> <p><em>What is the problem between when I use mapping and when I don't use it ?</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload