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 |
|
|
|
8 |
<script type="text/javascript" src="../../../dojo/dojo.js"
|
|
|
9 |
djConfig="isDebug: true, parseOnLoad: true, extraLocale: ['de-de', 'en-us']"></script>
|
|
|
10 |
<script type="text/javascript" src="../_testCommon.js"></script>
|
|
|
11 |
|
|
|
12 |
<script type="text/javascript">
|
|
|
13 |
dojo.require("dijit.form.NumberSpinner");
|
|
|
14 |
dojo.require("dojo.parser"); // scan page for widgets
|
|
|
15 |
</script>
|
|
|
16 |
<style type="text/css">
|
|
|
17 |
@import "../../../dojo/resources/dojo.css";
|
|
|
18 |
@import "../css/dijitTests.css";
|
|
|
19 |
|
|
|
20 |
#integerspinner2 .dojoSpinnerUpArrow {
|
|
|
21 |
border-bottom-color: blue;
|
|
|
22 |
}
|
|
|
23 |
#integerspinner2 .dojoSpinnerDownArrow {
|
|
|
24 |
border-top-color: red;
|
|
|
25 |
}
|
|
|
26 |
#integerspinner2 .dojoSpinnerButton {
|
|
|
27 |
background-color: yellow;
|
|
|
28 |
}
|
|
|
29 |
#integerspinner2 .dojoSpinnerButtonPushed {
|
|
|
30 |
background-color: gray;
|
|
|
31 |
}
|
|
|
32 |
#integerspinner2 .dojoSpinnerButtonPushed .dojoSpinnerDownArrow {
|
|
|
33 |
border-top-color: blue;
|
|
|
34 |
}
|
|
|
35 |
#integerspinner2 .dojoSpinnerButtonPushed .dojoSpinnerUpArrow {
|
|
|
36 |
border-bottom-color: red;
|
|
|
37 |
}
|
|
|
38 |
.dojoInputFieldValidationNormal#integerspinner2 {
|
|
|
39 |
color:blue;
|
|
|
40 |
background-color:pink;
|
|
|
41 |
}
|
|
|
42 |
</style>
|
|
|
43 |
</head>
|
|
|
44 |
|
|
|
45 |
<body>
|
|
|
46 |
<h1 class="testTitle">Dijit Spinner Test</h1>
|
|
|
47 |
Try typing values, and use the up/down arrow keys and/or the arrow push
|
|
|
48 |
buttons to spin
|
|
|
49 |
<br>
|
|
|
50 |
<form id="form1" action="" name="example" method="post">
|
|
|
51 |
<h1>number spinner</h1>
|
|
|
52 |
<br>
|
|
|
53 |
initial value=900, no delta specified, no min specified, max=1550, onChange captured<br>
|
|
|
54 |
<label for="integerspinner1">Spinbox #1: </label><br>
|
|
|
55 |
<input dojoType="dijit.form.NumberSpinner"
|
|
|
56 |
onChange="dojo.byId('oc1').value=arguments[0]"
|
|
|
57 |
value="900"
|
|
|
58 |
constraints="{max:1550,places:0}"
|
|
|
59 |
name="integerspinner1"
|
|
|
60 |
id="integerspinner1">
|
|
|
61 |
onChange:<input id="oc1" disabled value="not fired yet!" autocomplete="off">
|
|
|
62 |
<br>
|
|
|
63 |
<br>
|
|
|
64 |
initial value=1000, delta=10, min=9 max=1550<br>
|
|
|
65 |
<label for="integerspinner2">Spinbox with custom styling (width=50%): </label>
|
|
|
66 |
<input dojoType="dijit.form.NumberSpinner"
|
|
|
67 |
style="font-size:20pt;border:1px solid blue;width: 50%;"
|
|
|
68 |
value="1000"
|
|
|
69 |
smallDelta="10"
|
|
|
70 |
constraints="{min:9,max:1550,places:0}"
|
|
|
71 |
name="integerspinner2"
|
|
|
72 |
id="integerspinner2">
|
|
|
73 |
<br>
|
|
|
74 |
<br>
|
|
|
75 |
<label for="integertextbox3">Spinner line break test: </label>initial value not specified, delta not specified, min not specified, max not specified, signed not specified, separator not specified<br>
|
|
|
76 |
[verify no line break just after this text]
|
|
|
77 |
<input dojoType="dijit.form.NumberSpinner" name="integertextbox3" id="integertextbox3">
|
|
|
78 |
[verify no line break just before this text]
|
|
|
79 |
<br>
|
|
|
80 |
<br>
|
|
|
81 |
Move the cursor left and right within the input field to see the effect on the spinner.
|
|
|
82 |
<br>
|
|
|
83 |
initial value=+1.0, delta=0.1, min=-10.9, max=155, places=1, maxLength=20<br>
|
|
|
84 |
<label for="realspinner1">Real Number Spinbox #1: </label><br>
|
|
|
85 |
<input dojoType="dijit.form.NumberSpinner"
|
|
|
86 |
value="1.0"
|
|
|
87 |
smallDelta="0.1"
|
|
|
88 |
constraints={min:-10.9,max:155,places:1,round:true}
|
|
|
89 |
maxLength="20"
|
|
|
90 |
name="realspinner1"
|
|
|
91 |
id="realspinner1">
|
|
|
92 |
<br>
|
|
|
93 |
|
|
|
94 |
<script>
|
|
|
95 |
function displayData() {
|
|
|
96 |
var f = document.getElementById("form1");
|
|
|
97 |
var s = "";
|
|
|
98 |
for (var i = 0; i < f.elements.length; i++) {
|
|
|
99 |
var elem = f.elements[i];
|
|
|
100 |
if (elem.name == "button") { continue; }
|
|
|
101 |
s += elem.name + ": " + elem.value + "\n";
|
|
|
102 |
}
|
|
|
103 |
alert(s);
|
|
|
104 |
}
|
|
|
105 |
</script>
|
|
|
106 |
<div>
|
|
|
107 |
<button name="button" onclick="displayData(); return false;">view data</button>
|
|
|
108 |
<input type="submit" name="submit" />
|
|
|
109 |
</div>
|
|
|
110 |
|
|
|
111 |
</form>
|
|
|
112 |
</body>
|
|
|
113 |
</html>
|