2150 |
mathias |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
|
2 |
"http://www.w3.org/TR/html4/strict.dtd">
|
|
|
3 |
<html>
|
|
|
4 |
<head>
|
|
|
5 |
<title>Dojo Spinner Widget Test</title>
|
|
|
6 |
|
|
|
7 |
<style type="text/css">
|
|
|
8 |
@import "../../../dojo/resources/dojo.css";
|
|
|
9 |
@import "../../../dijit/themes/tundra/tundra.css";
|
|
|
10 |
@import "../../../dijit/themes/dijit.css";
|
|
|
11 |
@import "../../../dijit/tests/css/dijitTests.css";
|
|
|
12 |
</style>
|
|
|
13 |
|
|
|
14 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script>
|
|
|
15 |
|
|
|
16 |
<script type="text/javascript">
|
|
|
17 |
dojo.require("dojox.widget.TimeSpinner");
|
|
|
18 |
dojo.require("dojo.parser"); // scan page for widgets
|
|
|
19 |
|
|
|
20 |
function displayData() {
|
|
|
21 |
var spinner = dijit.byId("timeSpinner");
|
|
|
22 |
|
|
|
23 |
//accessing the widget property directly
|
|
|
24 |
console.log("TimeSpinner Value (raw, unserialized): ", spinner.getValue());
|
|
|
25 |
|
|
|
26 |
//accessing the widget from the form elements
|
|
|
27 |
var theForm = dojo.byId("form1");
|
|
|
28 |
var s = "";
|
|
|
29 |
for (var i=0; i<theForm.elements.length;i++){
|
|
|
30 |
var elem = theForm.elements[i];
|
|
|
31 |
if (!elem.name || elem.name =="button") { continue ; }
|
|
|
32 |
s+=elem.name + ": " + elem.value + "\n";
|
|
|
33 |
}
|
|
|
34 |
console.log(s);
|
|
|
35 |
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
</script>
|
|
|
39 |
<style type="text/css">
|
|
|
40 |
#integerspinner2 .dojoSpinnerUpArrow {
|
|
|
41 |
border-bottom-color: blue;
|
|
|
42 |
}
|
|
|
43 |
#integerspinner2 .dojoSpinnerDownArrow {
|
|
|
44 |
border-top-color: red;
|
|
|
45 |
}
|
|
|
46 |
#integerspinner2 .dojoSpinnerButton {
|
|
|
47 |
background-color: yellow;
|
|
|
48 |
}
|
|
|
49 |
#integerspinner2 .dojoSpinnerButtonPushed {
|
|
|
50 |
background-color: gray;
|
|
|
51 |
}
|
|
|
52 |
#integerspinner2 .dojoSpinnerButtonPushed .dojoSpinnerDownArrow {
|
|
|
53 |
border-top-color: blue;
|
|
|
54 |
}
|
|
|
55 |
#integerspinner2 .dojoSpinnerButtonPushed .dojoSpinnerUpArrow {
|
|
|
56 |
border-bottom-color: red;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
.dojoInputFieldValidationNormal#integerspinner2 {
|
|
|
60 |
color:blue;
|
|
|
61 |
background-color:pink;
|
|
|
62 |
}
|
|
|
63 |
</style>
|
|
|
64 |
</head>
|
|
|
65 |
|
|
|
66 |
<body class="tundra">
|
|
|
67 |
<h1 class="testTitle">Dojox TimeSpinner Test</h1>
|
|
|
68 |
Try typing values, and use the up/down arrow keys and/or the arrow push
|
|
|
69 |
buttons to spin
|
|
|
70 |
<br>
|
|
|
71 |
<form id="form1" action="" name="example" method="post">
|
|
|
72 |
<h1>time spinner</h1>
|
|
|
73 |
<br>
|
|
|
74 |
<input id="timeSpinner" dojoType="dojox.widget.TimeSpinner"
|
|
|
75 |
onChange="console.debug('onChange fired for widget id = ' + this.id + ' with value = ' + arguments[0]);"
|
|
|
76 |
value="12:30 PM"
|
|
|
77 |
name="timeSpinner"
|
|
|
78 |
hours="12"
|
|
|
79 |
id="timeSpinner" />
|
|
|
80 |
</form>
|
|
|
81 |
|
|
|
82 |
<div>
|
|
|
83 |
<button name="button" onclick="displayData(); return false;">view data</button>
|
|
|
84 |
</div>
|
|
|
85 |
|
|
|
86 |
</body>
|
|
|
87 |
</html>
|