| 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.Grid Programmatic Instantiation</title> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> |
| 7 | <style type="text/css"> |
| 8 | @import "../resources/Grid.css"; |
| 9 | @import "../resources/tundraGrid.css"; |
| 10 | @import "../../../dojo/resources/dojo.css"; |
| 11 | @import "../../../dijit/themes/tundra/tundra.css"; |
| 12 | @import "../../../dijit/tests/css/dijitTests.css"; |
| 13 | .heading { |
| 14 | font-weight: bold; |
| 15 | padding-bottom: 0.25em; |
| 16 | } |
| 17 | |
| 18 | #grid { |
| 19 | width: 100%; |
| 20 | height: 100%; |
| 21 | } |
| 22 | </style> |
| 23 | <script type="text/javascript" src="../../../dojo/dojo.js" |
| 24 | data-dojo-config="isDebug:false, debugAtAllCosts: false, parseOnLoad: true"></script> |
| 25 | <script type="text/javascript"> |
| 26 | dojo.require("dijit.dijit"); // optimize: load dijit layer |
| 27 | dojo.require("dijit.layout.TabContainer"); |
| 28 | dojo.require("dijit.layout.ContentPane"); |
| 29 | dojo.require("dojox.grid.DataGrid"); |
| 30 | dojo.require("dojo.data.ItemFileWriteStore"); |
| 31 | dojo.require("dojo.parser"); |
| 32 | </script> |
| 33 | <script type="text/javascript" src="support/test_data.js"></script> |
| 34 | <script type="text/javascript"> |
| 35 | dojo.addOnLoad(function(){ |
| 36 | |
| 37 | var tc = new dijit.layout.TabContainer({ |
| 38 | style:"height: 300px; width: 100%;" |
| 39 | }, "mainTabContainer"); |
| 40 | var cp = new dijit.layout.ContentPane({ title:"Tab 2" }, "cp"); |
| 41 | tc.addChild(cp); |
| 42 | tc.startup(); |
| 43 | |
| 44 | var layout = [[ |
| 45 | {name: 'Column 1', field: 'col1'}, |
| 46 | {name: 'Column 2', field: 'col2'}, |
| 47 | {name: 'Column 3', field: 'col3'}, |
| 48 | {name: 'Column 4', field: 'col4', width: "150px"}, |
| 49 | {name: 'Column 5', field: 'col5'} |
| 50 | ],[ |
| 51 | {name: 'Column 6', field: 'col6'}, |
| 52 | {name: 'Column 7', field: 'col7'}, |
| 53 | {name: 'Column 8'}, |
| 54 | {name: 'Column 9', field: 'col3', colSpan: 2} |
| 55 | ]]; |
| 56 | |
| 57 | var grid = new dojox.grid.DataGrid({ |
| 58 | title: "tab 1", |
| 59 | id: "grid", |
| 60 | store: test_store, |
| 61 | structure: layout |
| 62 | }); |
| 63 | tc.addChild(grid, 0); |
| 64 | }); |
| 65 | </script> |
| 66 | </head> |
| 67 | <body class="tundra"> |
| 68 | <div class="heading">dojox.grid.Grid Programmatic Instantiation Test</div> |
| 69 | <div id="mainTabContainer"> |
| 70 | <div id="cp"> |
| 71 | ... stuff ... |
| 72 | </div> |
| 73 | </div> |
| 74 | </body> |
| 75 | </html> |