]> git.pond.sub.org Git - eow/blobdiff - static/dojo-release-1.1.1/dojox/grid/tests/test_grid_programmatic_layout.html
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojox / grid / tests / test_grid_programmatic_layout.html
diff --git a/static/dojo-release-1.1.1/dojox/grid/tests/test_grid_programmatic_layout.html b/static/dojo-release-1.1.1/dojox/grid/tests/test_grid_programmatic_layout.html
new file mode 100644 (file)
index 0000000..b55d975
--- /dev/null
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
+       "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+       <head>
+               <title>Test dojox.Grid Programmatic Instantiation</title>
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+               <style type="text/css">
+                       @import "../_grid/tundraGrid.css";
+                       @import "../../../dojo/resources/dojo.css";
+                       @import "../../../dijit/themes/tundra/tundra.css";
+                       @import "../../../dijit/tests/css/dijitTests.css";
+                       .heading {
+                               font-weight: bold;
+                               padding-bottom: 0.25em;
+                       }
+                                       
+                       #grid { 
+                               width: 100%;
+                               height: 100%;
+                       }
+               </style>
+               <script type="text/javascript" src="../../../dojo/dojo.js" 
+                       djConfig="isDebug:false, debugAtAllCosts: false, parseOnLoad: true"></script>
+               <script type="text/javascript">
+                       dojo.require("dijit.layout.TabContainer");
+                       dojo.require("dijit.layout.ContentPane");
+                       dojo.require("dojox.grid.Grid");
+                       dojo.require("dojo.parser");
+               </script>
+               <script type="text/javascript" src="support/test_data.js"></script>
+               <script type="text/javascript">
+                       dojo.addOnLoad(function(){
+                               // a grid view is a group of columns
+                               var view1 = {
+                                       cells: [
+                                               [
+                                                       {name: 'Column 0'}, 
+                                                       {name: 'Column 1'}, 
+                                                       {name: 'Column 2'}, 
+                                                       {name: 'Column 3', width: "150px"}, 
+                                                       {name: 'Column 4'}
+                                               ],
+                                               [
+                                                       {name: 'Column 5'}, 
+                                                       {name: 'Column 6'}, 
+                                                       {name: 'Column 7'}, 
+                                                       {name: 'Column 8', field: 3, colSpan: 2}
+                                               ]
+                                       ]
+                               };
+                               // a grid layout is an array of views.
+                               var layout = [ view1 ];
+
+                               var grid = new dojox.Grid({
+                                       title: "tab 1",
+                                       id: "grid",
+                                       model: model,
+                                       structure: layout
+                               });
+                               dijit.byId("mainTabContainer").addChild(grid, 0);
+                               grid.render();
+                       });
+               </script>
+       </head>
+       <body class="tundra">
+               <div class="heading">dojox.Grid Programmatic Instantiation Test</div>
+               <div id="mainTabContainer" dojoType="dijit.layout.TabContainer"
+                       style="height: 300px; width: 100%;">
+                       <div dojoType="dijit.layout.ContentPane" title="Tab 2">
+                               ... stuff ...
+                       </div>
+               </div>
+       </body>
+</html>