Saturday, 15 January 2011

javascript - Knockout mapping does represent wished for html -


I have a problem with knockout mapping. I am using the knockout mapping plugin to represent a serialized form in JSN. It was working before using knockout mapping but I need to use knockout mapping because I want my properties to be viewable.

You can see the HTML working here:

Here is my Javascript code:

  var formData = {"Group name": [{"Group name": "property", "content": [{"title": "calculation method", "form type": "select", "value": [{"title": "Voltage drop" ("title": "Tolerance (% V)", "FormType": "Text Box", "Value" - "Unbalanced", "Selected": True}, {"Title": "Voltage Drop - Balanced "}}},: {" Title ":" counting options "," form type ":" radio "," value ": [{" title ":" flat star {Title}: "Adjust conductor resistance" ("in the named positions", "checked": incorrect}, {"title": "line conversion", "check": "check": true}]}, { True, "app label text": "aff"}}, {"group name": "text box", "disabled": true, "value": 77, "append label" "{{" Title ":" voltage drop - unbalanced "," selected ": true]: [{" title ":" calculation method "," form type ":" select "," value " , {"Title": "volta" drop-balance "}]}, {" top "", "Formattype": "Radio", "Value": ["Vertical" {"Headline": "Flat Start (on nominated situations", "checked": wrong}, {"title": "line transition", "checked": true}]}, "append labels": true , "Append labels": "append labels": "aff"}] {"title": "adjust on conductor resistance", "formatting": "text box", "disabled": true, "value": 77,}] }; Ko.mapping.fromJS (formData);   

The same code has JSField here:

What is the problem when I use mapping and when I do not use it?

In your second case you forgot to apply. .applyBindings (formData);

 ;    

No comments:

Post a Comment