48e434a408b13bc5c72c1044296eed907b5378ce.svn-base 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title>Test dojox.Grid Basic</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
  6. <style type="text/css">
  7. @import "../_grid/Grid.css";
  8. body {
  9. font-size: 0.9em;
  10. font-family: Geneva, Arial, Helvetica, sans-serif;
  11. }
  12. .heading {
  13. font-weight: bold;
  14. padding-bottom: 0.25em;
  15. }
  16. #grid {
  17. border: 1px solid #333;
  18. width: 35em;
  19. height: 30em;
  20. }
  21. </style>
  22. <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script>
  23. <!--<script type="text/javascript">
  24. dojo.require("dojox.grid.Grid");
  25. dojo.require("dojox.grid._data.model");
  26. dojo.require("dojo.parser");
  27. </script>-->
  28. <!-- Debugging -->
  29. <script type="text/javascript" src="../_grid/lib.js"></script>
  30. <script type="text/javascript" src="../_grid/drag.js"></script>
  31. <script type="text/javascript" src="../_grid/scroller.js"></script>
  32. <script type="text/javascript" src="../_grid/builder.js"></script>
  33. <script type="text/javascript" src="../_grid/cell.js"></script>
  34. <script type="text/javascript" src="../_grid/layout.js"></script>
  35. <script type="text/javascript" src="../_grid/rows.js"></script>
  36. <script type="text/javascript" src="../_grid/focus.js"></script>
  37. <script type="text/javascript" src="../_grid/selection.js"></script>
  38. <script type="text/javascript" src="../_grid/edit.js"></script>
  39. <script type="text/javascript" src="../_grid/view.js"></script>
  40. <script type="text/javascript" src="../_grid/views.js"></script>
  41. <script type="text/javascript" src="../_grid/rowbar.js"></script>
  42. <script type="text/javascript" src="../_grid/publicEvents.js"></script>
  43. <script type="text/javascript" src="../VirtualGrid.js"></script>
  44. <script type="text/javascript" src="../_data/fields.js"></script>
  45. <script type="text/javascript" src="../_data/model.js"></script>
  46. <script type="text/javascript" src="../_data/editors.js"></script>
  47. <script type="text/javascript" src="../Grid.js"></script>
  48. <script type="text/javascript" src="support/test_data.js"></script>
  49. <script type="text/javascript">
  50. // a grid view is a group of columns
  51. var view1 = {
  52. cells: [[
  53. {name: 'Column 0'}, {name: 'Column 1'}, {name: 'Column 2'}, {name: 'Column 3', width: "150px"}, {name: 'Column 4'},
  54. {name: 'Column 5'}, {name: 'Column 6'}, {name: 'Column 7', field: 0}, {name: 'Column 8'},
  55. {name: 'Column 9'}, {name: 'Column 10'}, {name: 'Column 11', field: 0}, {name: 'Column 12', width: "150px"}, {name: 'Column 13'},
  56. {name: 'Column 14'}, {name: 'Column 15'}, {name: 'Column 16', field: 0}, {name: 'Column 17'}
  57. ]]
  58. };
  59. // a grid layout is an array of views.
  60. var layout = [ view1 ];
  61. function keyDown(e) {
  62. switch(e.keyCode){
  63. case dojo.keys.LEFT_ARROW:
  64. console.log('left arrow!');
  65. break;
  66. case dojo.keys.RIGHT_ARROW:
  67. console.log('right arrow!');
  68. break;
  69. case dojo.keys.ENTER:
  70. console.log('enter!');
  71. break;
  72. }
  73. }
  74. dojo.addOnLoad(function() {
  75. window["grid"] = dijit.byId("grid");
  76. dojo.connect(grid, "onKeyDown", keyDown);
  77. });
  78. </script>
  79. </head>
  80. <body>
  81. <div class="heading">dojox.Grid Basic Test</div>
  82. <div id="grid" dojoType="dojox.Grid" model="model" structure="layout"></div>
  83. </body>
  84. </html>