Window

Description

The Window widget displays content in a modal or non-modal HTML window.

Official Kendo UI Window documentation

Examples

  • Basic Example
  • Passing additional options
  • Using global options

This example demonstrates passing basic options to the Window plugin.

<input type="checkbox" data-bind="checked: isOpen" /> Open<br/>
<div data-bind="kendoWindow: { isOpen: isOpen, visible: false }">
    Window Content
</div>
var ViewModel = function() {
   this.isOpen = ko.observable(false);
};

                            ko.applyBindings(new ViewModel());
Open
Window Content

This example demonstrates passing additional options in the data-bind attribute.

<input type="checkbox" data-bind="checked: isOpen" /> Open<br/>
<div data-bind="kendoWindow: { isOpen: isOpen, visible: false, actions: ['Close', 'Minimize', 'Maximize', 'Refresh'], modal: true }">
      Window Content
</div>
var ViewModel = function() {
   this.isOpen = ko.observable(false);
};

                            ko.applyBindings(new ViewModel());
Open
Window Content

This example demonstrates setting global options in ko.bindingHandlers.kendoWindow.options. This helps to simplify the markup for settings that can be used as a default for all instances of this widget.

<input type="checkbox" data-bind="checked: isOpen" /> Open<br/>
<div data-bind="kendoWindow: { isOpen: isOpen }">
    Window Content
</div>
var ViewModel = function() {
   this.isOpen = ko.observable(false);
};

ko.bindingHandlers.kendoWindow.options = {
   actions: ['Close', 'Minimize', 'Maximize', 'Refresh'],
   modal: true,
   visible: false
};

                            ko.applyBindings(new ViewModel());
Open
Window Content

Live Options

The kendoWindow.md binding accepts all of the options that can be specified for the widget. However, when bound against an observable, these live options will update the widget or respond to updates from interactions with the widget.
isOpen

Controls whether the window is visible

title

Determines the title of the window

content

A URL to load content into the window

widget

If specified, will populate an observable with a reference to the actual widget