Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MASTERING KNOCKOUTJS

You're reading from   MASTERING KNOCKOUTJS Use and extend Knockout to deliver feature-rich, modern web applications

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783981007
Length 270 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Timothy Moran Timothy Moran
Author Profile Icon Timothy Moran
Timothy Moran
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Knockout Essentials 2. Extending Knockout with Custom Binding Handlers FREE CHAPTER 3. Extending Knockout with Preprocessors and Providers 4. Application Development with Components and Modules 5. Durandal – the Knockout Framework 6. Advanced Durandal 7. Best Practices 8. Plugins and Other Knockout Libraries 9. Under the Hood Index

Custom modal dialogs


In Durandal, a dialog context is the viewmodel that controls a modal dialog. It has a method used to add the modal dialog host, which is the DOM node inside which the modal content will be placed.

Durandal offers two modal dialogs out of the box: message boxes and the default context. The message box that Durandal offers adds some simple DOM elements to the default context and is very useful in order to show short messages to the user. The default dialog context can host any composable module, including message boxes. If you want to use your own dialog box, such as the one included in Twitter Bootstrap, it is possible to add it as a dialog context.

A dialog context is an object that can create a dialog in the DOM to which the composition can add content. A custom context uses the following APIs:

  • addHost(dialog): This function is responsible for creating the dialog itself, by adding it to the DOM. It must assign the dialog.host property on the parameter to this DOM node...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime