The original "checked" state of the switch with jQuery Mobile + knockout.js

I cannot understand why the initial state of my user interface does not have the first switch in the 'checked' state. Here's jsFiddle: http://jsfiddle.net/floyd_may/JcTxT/

However, this jsFiddle works very well here, even if you change it to change it to radio inputs (instead of checkbox ): http://jsfiddle.net/rniemeyer/EGAH9/

You will begin to think that perhaps jQuery Mobile has a part to play in all of this; however, in this version of my original violin, parts of jQuery Mobile are cut out and still do not work: http://jsfiddle.net/floyd_may/JcTxT/5/

Why doesn't the β€œchild 1” checked switch appear at first?

+4
source share
1 answer

Reordering the binding order did this: http://jsfiddle.net/JcTxT/6/

value: name, checked: $root.selectedName instead

checked: $root.selectedName, value: name

+6
source

Source: https://habr.com/ru/post/1434233/


All Articles