da91791410e62061d8f10ad62fe351e12ead8906.svn-base 2.4 KB

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