HTML5 App with MVVM and Knockout Study(2)
2012-10-06 04:36
302 查看
Study (2) Built In Bindings
Binding - Text and HTML
TEXT renders the text itself, while HTML renders with html syntax:
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210060435422304.png)
run the code in jsFiddle
Binding - Checkbox and Radio Button
For Radio buttons, only if the value attribute equals to the data binding parameter “checked”, KO will set the radio button to be checked, so the parameter value should be a string.
For Checkboxes, KO will set the element to be checked when the parameter value is
Read this document for details
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210060456511246.png)
run the code in jsFiddle
Binding - List(single and multiple)
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210092332471912.png)
run the code in jsFiddle
Binding - enable/disable
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210092346591478.png)
run the code in jsFiddle
Binding - Focus/visible
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210100048439559.png)
run this in jsFiddle
Binding - click and event
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210100459199518.png)
run the code in jsFiddle
Binding - CSS and Styling
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/20121010045924418.png)
run the code in jsFiddle
Binding – Attribute
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/20121010045929937.png)
run the code in jsFiddle
Binding - Text and HTML
TEXT renders the text itself, while HTML renders with html syntax:
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210060435422304.png)
run the code in jsFiddle
Binding - Checkbox and Radio Button
For Radio buttons, only if the value attribute equals to the data binding parameter “checked”, KO will set the radio button to be checked, so the parameter value should be a string.
For Checkboxes, KO will set the element to be checked when the parameter value is
true, and unchecked when it is
false.
Read this document for details
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210060456511246.png)
run the code in jsFiddle
Binding - List(single and multiple)
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210092332471912.png)
run the code in jsFiddle
Binding - enable/disable
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210092346591478.png)
run the code in jsFiddle
Binding - Focus/visible
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210100048439559.png)
run this in jsFiddle
Binding - click and event
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/201210100459199518.png)
run the code in jsFiddle
Binding - CSS and Styling
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/20121010045924418.png)
run the code in jsFiddle
Binding – Attribute
![](http://images.cnblogs.com/cnblogs_com/tech9/201210/20121010045929937.png)
run the code in jsFiddle
相关文章推荐
- HTML5 App with MVVM and Knockout Study(4)
- HTML5 App with MVVM and Knockout Study(3)
- HTML5 App with MVVM and Knockout Study(1)
- Universal Windows App Development with Cortana and the Speech SDK 3
- ASENET MVC 5 with Bootstrap and Knockout.js 第一弹
- Financial Inquiry via FAXOLFIN And FAXASSET Fails With APP-OFA-48269 Unknown Error (文档 ID 749444.1)
- Windows Phone 7 Tombstoning with MVVM and Sterling
- app:transformClassesAndResourcesWithProguardForBaiduRelease
- Improving Web App Performance With the Chrome DevTools Timeline and Profiles
- Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'. > Job faile
- hello,every one ...i am happy to have a chance to study with you and i hope i can promote everyday!
- Silverlight 4 - MVVM with Commanding and WCF RIA Services
- Bring Your Charts to Life with HTML5 Canvas and JavaScript
- The Study of Programming Windows with MFC--Imagelist and ComboBoxEx
- Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. > Job fai
- Android bugly报错信息Execution failed fortask ':app:transformClassesAndResourcesWithProguardForRelease'.
- 10 Best Hybrid Mobile App UI Frameworks: HTML5, CSS and JS
- [NEWS]Microsoft expands partnerships with AOL and AppNexus, Bing to power search for AOL properties
- Error:Execution failed for task ':app:transformClassesAndResourcesWithProgua
- Universal Windows App Development with Cortana and the Speech SDK 6