3866 Views

Knockout

Last updated 2 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 

Background

Knockout (AKA KnockoutJS) is a javascript library which implements the Model View ViewModel architectural pattern to help build rich, responsive displays and user interfaces. The library allows for:

  • Dependency tracking - automatically updates the right parts of your UI whenever your data model changes.
  • Declarative bindings - a simple and obvious way to connect parts of your UI to your data model. You can construct a complex dynamic UIs easily using arbitrarily nested binding contexts.

Within DotNetNuke

Knockout was first added in the 6.2.0 release of DotNetNuke and is used in many of the components introduced in that version including the message centre, journal and member directory. In addition other areas such as the user profile were enhanced to use it. In the cases of the member directory and user profile, these extensions both expose the knockout scripts as templates so that site administrators can apply their own markup if desired.

If you wish to include knockout in your own extensions (targetted 6.2.0 and beyond releases), it's recommend that you use the Client Resource Management API to ensure only a single copy of the script is included and that it is minimized and compacted (if your install has chosen those options). To do so use the following line:

<dnn:DnnJsInclude ID="DnnJsInclude" runat="server" FilePath="~/Resources/Shared/scripts/knockout.js" />

Note: since DNN 7.2.0 the recommended approach is to use the JavaScript library support e.g.

JavaScript.RequestRegistration(CommonJs.Knockout);

References

Contents
No sections defined

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out