538316536bafe480733511e4e71953f4c8c9006f.svn-base 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Test dojox.Grid Programmatic Instantiation</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
  7. <style type="text/css">
  8. @import "../_grid/tundraGrid.css";
  9. @import "../../../dojo/resources/dojo.css";
  10. @import "../../../dijit/themes/tundra/tundra.css";
  11. @import "../../../dijit/tests/css/dijitTests.css";
  12. .heading {
  13. font-weight: bold;
  14. padding-bottom: 0.25em;
  15. }
  16. #grid {
  17. width: 100%;
  18. height: 100%;
  19. }
  20. </style>
  21. <script type="text/javascript" src="../../../dojo/dojo.js"
  22. djConfig="isDebug:false, debugAtAllCosts: false, parseOnLoad: true"></script>
  23. <script type="text/javascript">
  24. dojo.require("dijit.layout.TabContainer");
  25. dojo.require("dijit.layout.ContentPane");
  26. dojo.require("dojox.grid.Grid");
  27. dojo.require("dojox.grid._data.model");
  28. dojo.require("dojo.parser");
  29. </script>
  30. <script type="text/javascript" src="support/test_data.js"></script>
  31. <script type="text/javascript">
  32. dojo.addOnLoad(function(){
  33. // a grid view is a group of columns
  34. var view1 = {
  35. cells: [
  36. [
  37. {name: 'Column 0'},
  38. {name: 'Column 1'},
  39. {name: 'Column 2'},
  40. {name: 'Column 3', width: "150px"},
  41. {name: 'Column 4'}
  42. ],
  43. [
  44. {name: 'Column 5'},
  45. {name: 'Column 6'},
  46. {name: 'Column 7'},
  47. {name: 'Column 8', field: 3, colSpan: 2}
  48. ]
  49. ]
  50. };
  51. // a grid layout is an array of views.
  52. var layout = [ view1 ];
  53. var grid = new dojox.Grid({
  54. title: "tab 1",
  55. id: "grid",
  56. model: model,
  57. structure: layout
  58. });
  59. dijit.byId("mainTabContainer").addChild(grid, 0);
  60. grid.render();
  61. });
  62. </script>
  63. </head>
  64. <body class="tundra">
  65. <div class="heading">dojox.Grid Programmatic Instantiation Test</div>
  66. <div id="mainTabContainer" dojoType="dijit.layout.TabContainer"
  67. style="height: 300px; width: 100%;">
  68. <div dojoType="dijit.layout.ContentPane" title="Tab 2">
  69. ... stuff ...
  70. </div>
  71. </div>
  72. </body>
  73. </html>