1 | <!doctype html> |
---|
2 | <html lang="en"> |
---|
3 | <head> |
---|
4 | <title>Knockout - Progress Bar</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.wijprogressbar.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.wijtooltip.js" |
---|
14 | type="text/javascript"></script> |
---|
15 | <script src="../../../../Wijmo-Open/development-bundle/wijmo/jquery.wijmo.wijprogressbar.js" |
---|
16 | type="text/javascript"></script> |
---|
17 | <script src="../../../../Wijmo-Open/development-bundle/external/knockout-2.0.0.js" |
---|
18 | type="text/javascript"></script> |
---|
19 | <script src="../../../../Wijmo-Open/development-bundle/external/knockout.wijmo.js" |
---|
20 | type="text/javascript"></script> |
---|
21 | <script type="text/javascript"> |
---|
22 | //Create ViewModel |
---|
23 | var viewModel = function () { |
---|
24 | var self = this; |
---|
25 | self.percent = ko.observable(0); |
---|
26 | self.val = ko.observable(0); |
---|
27 | self.min = ko.observable(0); |
---|
28 | self.max = ko.observable(100); |
---|
29 | self.disabled = ko.observable(false); |
---|
30 | self.labelAlign = ko.observable('center'); |
---|
31 | self.fillDirection = ko.observable('east'); |
---|
32 | self.lfs = ko.observable('{1}%'); |
---|
33 | self.tfs = ko.observable('{1}%'); |
---|
34 | self.increment = ko.observable(1); |
---|
35 | self.img = ko.observable(''); |
---|
36 | self.delay = ko.observable(0); |
---|
37 | self.aniDisabled = ko.observable(false); |
---|
38 | self.easing = ko.observable(null); |
---|
39 | self.duration = ko.numericObservable(500); |
---|
40 | }; |
---|
41 | |
---|
42 | //Bind ViewModel |
---|
43 | $(document).ready(function () { |
---|
44 | var vm = new viewModel(); |
---|
45 | ko.applyBindings(vm, $(".container").get(0)); |
---|
46 | vm.percent(0.5); |
---|
47 | vm.val(50); |
---|
48 | }); |
---|
49 | </script> |
---|
50 | </head> |
---|
51 | <body class="demo-single"> |
---|
52 | <div class="container"> |
---|
53 | <div class="header"> |
---|
54 | <h2> |
---|
55 | Progress Bar</h2> |
---|
56 | </div> |
---|
57 | <div class="main demo"> |
---|
58 | <!-- Begin demo markup --> |
---|
59 | <div data-bind="wijprogressbar: {value: val, minValue: min, maxValue: max, disabled: disabled, labelAlign: labelAlign, fillDirection: fillDirection, |
---|
60 | labelFormatString: lfs, toolTipFormatString: tfs, indicatorIncrement: increment, indicatorImage: img, animationDelay: delay, animationOptions: { |
---|
61 | disabled: aniDisabled, easing: easing, duration: duration}}"> |
---|
62 | </div> |
---|
63 | <div style="height: 250px"> |
---|
64 | </div> |
---|
65 | <!-- End demo markup --> |
---|
66 | <div class="demo-options"> |
---|
67 | <!-- Begin options markup --> |
---|
68 | <ul> |
---|
69 | <li> |
---|
70 | <label> |
---|
71 | <span>disabled:</span></label><input type="checkbox" data-bind="checked: disabled" /> |
---|
72 | </li> |
---|
73 | <li> |
---|
74 | <label> |
---|
75 | <span>value:</span></label><input type="text" data-bind="value: val" /> |
---|
76 | </li> |
---|
77 | <li> |
---|
78 | <label> |
---|
79 | <span>min:</span></label><input type="text" data-bind="value: min" /> |
---|
80 | </li> |
---|
81 | <li> |
---|
82 | <label> |
---|
83 | <span>max:</span></label><input type="text" data-bind="value: max" /> |
---|
84 | </li> |
---|
85 | <li> |
---|
86 | <label> |
---|
87 | <span>labelAlign::</span></label><select data-bind="value: labelAlign"> |
---|
88 | <option value="west">west</option> |
---|
89 | <option value="east">east</option> |
---|
90 | <option value="south">south</option> |
---|
91 | <option value="north">north</option> |
---|
92 | <option value="center">center</option> |
---|
93 | <option value="running">running</option> |
---|
94 | </select> |
---|
95 | </li> |
---|
96 | <li> |
---|
97 | <label> |
---|
98 | <span>fillDirection:</span></label></span></label><select data-bind="value: fillDirection"> |
---|
99 | <option value="west">west</option> |
---|
100 | <option value="east">east</option> |
---|
101 | <option value="south">south</option> |
---|
102 | <option value="north">north</option> |
---|
103 | </select> |
---|
104 | </li> |
---|
105 | <li> |
---|
106 | <label> |
---|
107 | <span>labelFormatString:</span></label><input type="text" data-bind="value: lfs" /> |
---|
108 | </li> |
---|
109 | <li> |
---|
110 | <label> |
---|
111 | <span>toolTipFormatString:</span></label><input type="text" data-bind="value: tfs" /> |
---|
112 | </li> |
---|
113 | <li> |
---|
114 | <label> |
---|
115 | <span>indicatorIncrement:</span></label><input type="text" data-bind="value: increment" /> |
---|
116 | </li> |
---|
117 | <li> |
---|
118 | <label> |
---|
119 | <span>indicatorImage:</span></label><input type="text" data-bind="value: img" /> |
---|
120 | </li> |
---|
121 | <li> |
---|
122 | <label> |
---|
123 | <span>animationDelay:</span></label><input type="text" data-bind="value: delay" /> |
---|
124 | </li> |
---|
125 | <li> |
---|
126 | <label> |
---|
127 | <span>animation.disabled:</span></label><input type="checkbox" data-bind="checked: aniDisabled" /> |
---|
128 | </li> |
---|
129 | <li> |
---|
130 | <label> |
---|
131 | <span>animation.easing:</span></label><input type="text" data-bind="value: easing" /> |
---|
132 | </li> |
---|
133 | <li> |
---|
134 | <label> |
---|
135 | <span>animation.duration:</span></label><input type="text" data-bind="value: duration" /> |
---|
136 | </li> |
---|
137 | </ul> |
---|
138 | <!-- End options markup --> |
---|
139 | </div> |
---|
140 | </div> |
---|
141 | <div class="footer demo-description"> |
---|
142 | <p> |
---|
143 | Wijmo provides a Knockout Integration Library so that all jQuery UI and Wijmo widgets |
---|
144 | can be used with Knockout declarative syntax. |
---|
145 | </p> |
---|
146 | </div> |
---|
147 | </div> |
---|
148 | </body> |
---|
149 | </html> |
---|