1 | <!doctype html> |
---|
2 | <html lang="en"> |
---|
3 | <head> |
---|
4 | <title>Knockout - Dialog</title> |
---|
5 | <link href="../../../../Wijmo-Open/development-bundle/themes/rocket/jquery-wijmo.css" |
---|
6 | rel="stylesheet" type="text/css" /> |
---|
7 | <link href="../../../../Wijmo-Open/development-bundle/themes/wijmo/jquery.wijmo.wijdialog.css" |
---|
8 | rel="stylesheet" type="text/css" /> |
---|
9 | <script src="../../external/jquery-1.8.0.min.js" type="text/javascript"></script> |
---|
10 | <script src="../../external/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script> |
---|
11 | <script src="../../../../Wijmo-Open/development-bundle/wijmo/jquery.wijmo.wijutil.js" |
---|
12 | type="text/javascript"></script> |
---|
13 | <script src="../../../../Wijmo-Open/development-bundle/wijmo/jquery.wijmo.wijdialog.js" |
---|
14 | type="text/javascript"></script> |
---|
15 | <script src="../../../../Wijmo-Open/development-bundle/external/knockout-2.0.0.js" |
---|
16 | type="text/javascript"></script> |
---|
17 | <script src="../../../../Wijmo-Open/development-bundle/external/knockout.wijmo.js" |
---|
18 | type="text/javascript"></script> |
---|
19 | <script type="text/javascript"> |
---|
20 | //Create ViewModel |
---|
21 | var viewModel = function () { |
---|
22 | var self = this; |
---|
23 | self.disabled = ko.observable(false); |
---|
24 | self.autoOpen = ko.observable(true); |
---|
25 | self.draggable = ko.observable(true); |
---|
26 | self.modal = ko.observable(false); |
---|
27 | self.resizable = ko.observable(true); |
---|
28 | }; |
---|
29 | |
---|
30 | //Bind ViewModel |
---|
31 | $(document).ready(function () { |
---|
32 | var vm = new viewModel(); |
---|
33 | ko.applyBindings(vm, $(".container").get(0)); |
---|
34 | }); |
---|
35 | </script> |
---|
36 | </head> |
---|
37 | <body class="demo-single"> |
---|
38 | <div class="container"> |
---|
39 | <div class="header"> |
---|
40 | <h2> |
---|
41 | Dialog</h2> |
---|
42 | </div> |
---|
43 | <div class="main demo"> |
---|
44 | <!-- Begin demo markup --> |
---|
45 | <div style="height: 400px"> |
---|
46 | </div> |
---|
47 | <div id="dialog" data-bind="wijdialog: {disabled: disabled, autoOpen: autoOpen, draggable: draggable, modal: modal, resizable: resizable }" |
---|
48 | title="Basic dialog"> |
---|
49 | <p> |
---|
50 | This is the default dialog which is useful for displaying information. The dialog |
---|
51 | window can be moved, resized, and closed with the 'x' icon.</p> |
---|
52 | </div> |
---|
53 | <!-- End demo markup --> |
---|
54 | <div class="demo-options"> |
---|
55 | <!-- Begin options markup --> |
---|
56 | <ul> |
---|
57 | <li> |
---|
58 | <label> |
---|
59 | <span>disabled:</span></label><input type="checkbox" data-bind="checked: disabled" /> |
---|
60 | </li> |
---|
61 | <li> |
---|
62 | <label> |
---|
63 | <span>autoOpen:</span></label><input type="checkbox" data-bind="checked: autoOpen" /> |
---|
64 | </li> |
---|
65 | <li> |
---|
66 | <label> |
---|
67 | <span>draggable:</span></label><input type="checkbox" data-bind="checked: draggable" /> |
---|
68 | </li> |
---|
69 | <li> |
---|
70 | <label> |
---|
71 | <span>modal:</span></label><input type="checkbox" data-bind="checked: modal" /> |
---|
72 | </li> |
---|
73 | <li> |
---|
74 | <label> |
---|
75 | <span>resizable:</span></label><input type="checkbox" data-bind="checked: resizable" /> |
---|
76 | </li> |
---|
77 | </ul> |
---|
78 | <div> |
---|
79 | <input type="button" value="Hide Dialog" onclick="$('#dialog').wijdialog('close')" /> |
---|
80 | <input type="button" value="Show Dialog" onclick="$('#dialog').wijdialog('open')" /> |
---|
81 | </div> |
---|
82 | <!-- End options markup --> |
---|
83 | </div> |
---|
84 | </div> |
---|
85 | <div class="footer demo-description"> |
---|
86 | <p> |
---|
87 | Wijmo provides a Knockout Integration Library so that all jQuery UI and Wijmo widgets |
---|
88 | can be used with Knockout declarative syntax. |
---|
89 | </p> |
---|
90 | </div> |
---|
91 | </div> |
---|
92 | </body> |
---|
93 | </html> |
---|