SlideShare a Scribd company logo
Brian Dukes
Engage

RESPONSIVE VIEWS WITH
KNOCKOUT
Who Are You
   Chief Software Architect
   Engage
   St. Louis, MO
   Working with DNN since 2008
   Using Knockout on personal and professional
    projects since early 2011
Where Are You Taking Me
   Why Knockout
   What is Knockout
   How do I Knockout
Getting Truth out of the DOM
   Yehuda Katz – ember.js
   MVC & MVVM Frameworks
Goal
   Getting your data out of the DOM
    – Stop handling jQuery events
Prerequisites
   JavaScript
   HTML
Knockout is JavaScript
   JavaScript: The Good Parts
     – by Douglas Crockford
   JavaScript Enlightenment
     – by Cody Lindley
     – http://javascriptenlightenment.com/
Cleanliness
“I don’t think Knockout is used (primarily) by devs
that care much about keeping their javascript
clean.”
– Rob Conery
What is Knockout
 What are the features
 What does it look like
Scenario
{ formId: 1,
  title: 'Contact Form',
  questions: [{
    title: 'Name',
    type: 'text'
  }, {
    title: 'Reason',
    type: 'dropdown',
    answers: ['Sales', 'Support']
  }, {
    title: 'Message',
    type: 'textarea' }]
}
Demo One
   Learn about: Data binding
   Task: Show the form title
Demo Two
   Learn about: Templating
   Task: List the questions
Demo Three
   Learn about: Observables
   Task: Edit question text
Demo Four
   Learn about: Dependency Tracking
   Task: Display answer input
How Do I Use Knockout
 In ASP.NET
 In DotNetNuke
 With a Database
Client Resource Management
   DNN 6.2
<%@ Register TagPrefix="dnn"
Namespace="DotNetNuke.Web.Client.ClientRe
sourceManagement"
Assembly="DotNetNuke.Web.Client" %>
<dnn:DnnJsInclude runat="server"
FilePath="knockout.js"
PathNameAlias="SharedScripts" />
How Do I Get the Model?
   Knockout.binding plugin
   JavaScript Serializer
   DNN Services Framework
How Do I Tell the Server About Updates?
   DNN Services Framework
   Serialize view model to hidden field
   Just manage existing ASP.NET control
Validation
   HTML 5 Validation
   ASP.NET Validation
   jQuery Validation
   is*Valid computed properties
Demo Five
   Fill it out
Resources
   http://learn.knockoutjs.com/
   http://knockoutjs.com/
Conclusion
 JavaScript model
 DOM binding
 Code cleanliness
 Ease of development and organization

More Related Content

KEY
Knockout.js presentation
PDF
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
PPTX
How my team is applying JS framework for PHP projects.
PPTX
PDF
WebSockets Jump Start
PPTX
Introduction à AngularJS
PPTX
Introduction to React and MobX
PPTX
Fundaments of Knockout js
Knockout.js presentation
Mocks, Proxies, and Transpilation as Development Strategies for Web Development
How my team is applying JS framework for PHP projects.
WebSockets Jump Start
Introduction à AngularJS
Introduction to React and MobX
Fundaments of Knockout js

What's hot (7)

PDF
Knockout js session
PDF
ASP.NET-Web Programming - Sessions and Cookies
PPTX
Getting classy with ES6
PPT
KnockoutJS and MVVM
DOCX
jQuery Code Testing
PPTX
Knockout js
PPTX
Dom selecting & jQuery
Knockout js session
ASP.NET-Web Programming - Sessions and Cookies
Getting classy with ES6
KnockoutJS and MVVM
jQuery Code Testing
Knockout js
Dom selecting & jQuery
Ad

Viewers also liked (6)

PPT
DNNcon 2016: Are There Security Flaws in Your DNN Modules?
PPT
Analytics In, Analytics Out: Using Google Analytics to Guide and Grade Web Pr...
ODP
Packaging DNN extensions
ODP
Considerations with Writing JavaScript in your DotNetNuke site
PPTX
Creating URL Providers for your Custom Extensions
PPTX
Enterprise Social Networking
DNNcon 2016: Are There Security Flaws in Your DNN Modules?
Analytics In, Analytics Out: Using Google Analytics to Guide and Grade Web Pr...
Packaging DNN extensions
Considerations with Writing JavaScript in your DotNetNuke site
Creating URL Providers for your Custom Extensions
Enterprise Social Networking
Ad

Similar to Responsive Views with Knockout (20)

DOCX
Dotnet training syallbus
DOCX
dotnet development company in chennai
DOCX
dotnet syallbus
DOCX
Dotnet courses
DOCX
dotnet training center and development
DOCX
dotnet courses in chennai
DOCX
dotnet development
DOCX
dotnet development company
DOCX
DOTNET TRAINING CENTER IN CHENNAI
DOCX
dotnet training center in chennai
DOCX
dotnet training center near vadapalani
DOCX
dotnet training center in vadapalani
PDF
Knockout mvvm-m1-slides
PDF
Yeoman AngularJS and D3 - A solid stack for web apps
PDF
CAW_Lecture2_10102023.pdfewwwwwwwwwwwwwww
PDF
Top 45 jQuery Interview Questions and Answers | Edureka
PDF
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
PPTX
Intro to MVC 3 for Government Developers
PDF
gDayX - Advanced angularjs
PDF
The State of Front-end At CrowdTwist
Dotnet training syallbus
dotnet development company in chennai
dotnet syallbus
Dotnet courses
dotnet training center and development
dotnet courses in chennai
dotnet development
dotnet development company
DOTNET TRAINING CENTER IN CHENNAI
dotnet training center in chennai
dotnet training center near vadapalani
dotnet training center in vadapalani
Knockout mvvm-m1-slides
Yeoman AngularJS and D3 - A solid stack for web apps
CAW_Lecture2_10102023.pdfewwwwwwwwwwwwwww
Top 45 jQuery Interview Questions and Answers | Edureka
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
Intro to MVC 3 for Government Developers
gDayX - Advanced angularjs
The State of Front-end At CrowdTwist

More from Engage Software (8)

PDF
The Importance of UX in Association Website Design
PDF
Millennial Engagement Strategies for Associations
PPT
JavaScript: The Language
PDF
Building A Membership Provider For DotNetNuke 4.X.X
PPT
Building DotNetNuke Modules
PDF
DotNetNuke In An Hour
PDF
The Right Way To Install Upgrade Dnn
PDF
What’s New In DotNetNuke 5 (Cambrian)
The Importance of UX in Association Website Design
Millennial Engagement Strategies for Associations
JavaScript: The Language
Building A Membership Provider For DotNetNuke 4.X.X
Building DotNetNuke Modules
DotNetNuke In An Hour
The Right Way To Install Upgrade Dnn
What’s New In DotNetNuke 5 (Cambrian)

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Artificial Intelligence
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Getting Started with Data Integration: FME Form 101
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
1. Introduction to Computer Programming.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
August Patch Tuesday
Approach and Philosophy of On baking technology
A Presentation on Artificial Intelligence
Advanced methodologies resolving dimensionality complications for autism neur...
Getting Started with Data Integration: FME Form 101
Assigned Numbers - 2025 - Bluetooth® Document
SOPHOS-XG Firewall Administrator PPT.pptx
NewMind AI Weekly Chronicles - August'25-Week II
1. Introduction to Computer Programming.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
Diabetes mellitus diagnosis method based random forest with bat algorithm
cloud_computing_Infrastucture_as_cloud_p
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Tartificialntelligence_presentation.pptx
Programs and apps: productivity, graphics, security and other tools
A comparative analysis of optical character recognition models for extracting...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
August Patch Tuesday

Responsive Views with Knockout

  • 2. Who Are You  Chief Software Architect  Engage  St. Louis, MO  Working with DNN since 2008  Using Knockout on personal and professional projects since early 2011
  • 3. Where Are You Taking Me  Why Knockout  What is Knockout  How do I Knockout
  • 4. Getting Truth out of the DOM  Yehuda Katz – ember.js  MVC & MVVM Frameworks
  • 5. Goal  Getting your data out of the DOM – Stop handling jQuery events
  • 6. Prerequisites  JavaScript  HTML
  • 7. Knockout is JavaScript  JavaScript: The Good Parts – by Douglas Crockford  JavaScript Enlightenment – by Cody Lindley – http://javascriptenlightenment.com/
  • 8. Cleanliness “I don’t think Knockout is used (primarily) by devs that care much about keeping their javascript clean.” – Rob Conery
  • 9. What is Knockout  What are the features  What does it look like
  • 10. Scenario { formId: 1, title: 'Contact Form', questions: [{ title: 'Name', type: 'text' }, { title: 'Reason', type: 'dropdown', answers: ['Sales', 'Support'] }, { title: 'Message', type: 'textarea' }] }
  • 11. Demo One  Learn about: Data binding  Task: Show the form title
  • 12. Demo Two  Learn about: Templating  Task: List the questions
  • 13. Demo Three  Learn about: Observables  Task: Edit question text
  • 14. Demo Four  Learn about: Dependency Tracking  Task: Display answer input
  • 15. How Do I Use Knockout  In ASP.NET  In DotNetNuke  With a Database
  • 16. Client Resource Management  DNN 6.2 <%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientRe sourceManagement" Assembly="DotNetNuke.Web.Client" %> <dnn:DnnJsInclude runat="server" FilePath="knockout.js" PathNameAlias="SharedScripts" />
  • 17. How Do I Get the Model?  Knockout.binding plugin  JavaScript Serializer  DNN Services Framework
  • 18. How Do I Tell the Server About Updates?  DNN Services Framework  Serialize view model to hidden field  Just manage existing ASP.NET control
  • 19. Validation  HTML 5 Validation  ASP.NET Validation  jQuery Validation  is*Valid computed properties
  • 20. Demo Five  Fill it out
  • 21. Resources  http://learn.knockoutjs.com/  http://knockoutjs.com/
  • 22. Conclusion  JavaScript model  DOM binding  Code cleanliness  Ease of development and organization

Editor's Notes

  • #3: http://jsfiddle.net/bdukes/vndBJ/&lt;h2 data-bind=&quot;text: title&quot;&gt;&lt;/h2&gt;ko.applyBindings(model, scope)
  • #4: http://jsfiddle.net/bdukes/ZP6FM/&lt;ol data-bind=&quot;foreach: questions&quot;&gt;  &lt;li data-bind=&quot;text: title&quot;&gt;&lt;/li&gt;&lt;/ol&gt;
  • #5: http://jsfiddle.net/bdukes/uLfpx/&lt;ol data-bind=&quot;foreach: questions&quot;&gt; &lt;li&gt;   &lt;label data-bind=&quot;attr: { for: &apos;q&apos; + $index }&quot;&gt;     Question:   &lt;/label&gt;   &lt;input data-bind=&quot;value: title, attr: { id: &apos;q&apos; + $index }&quot; /&gt; &lt;/li&gt;&lt;/ol&gt;title: ko.observable(&apos;Reason&apos;)
  • #6: http://jsfiddle.net/bdukes/9XLnk/&lt;ol data-bind=&quot;foreach: questions&quot;&gt; &lt;li&gt;   &lt;label data-bind=&quot;text: title, attr: { for: &apos;eq&apos; + $index() }&quot;&gt;&lt;/label&gt;   &lt;!-- ko if: isText --&gt;   &lt;input data-bind=&quot;attr: { id: &apos;eq&apos; + $index() }&quot; /&gt;   &lt;!-- /ko --&gt;   &lt;!-- ko if: isTextarea --&gt;   &lt;textarea data-bind=&quot;attr: { id: &apos;eq&apos; + $index() }&quot;&gt;&lt;/textarea&gt;   &lt;!-- /ko --&gt;   &lt;!-- ko if: isDropdown --&gt;   &lt;select data-bind=&quot;attr: { id: &apos;eq&apos; + $index() }, options: answers&quot;&gt;   &lt;/select&gt;   &lt;!-- /ko --&gt; &lt;/li&gt;&lt;/ol&gt;isText: ko.computed(function () { return self.type() === &apos;text&apos;; })