Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

11850 Views

Knockout

Last updated 9 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
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out