| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 5 | <head> |
| 6 | <title>Test dojox.grid.Grid layout in a BorderContainer</title> |
| 7 | <style> |
| 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 | |
| 14 | html, body { |
| 15 | width: 100%; /* make the body expand to fill the visible window */ |
| 16 | height: 100%; |
| 17 | overflow: hidden; /* erase window level scrollbars */ |
| 18 | padding: 0 0 0 0; |
| 19 | margin: 0 0 0 0; |
| 20 | } |
| 21 | </style> |
| 22 | <script type="text/javascript" src="../../../dojo/dojo.js" |
| 23 | data-dojo-config="isDebug: false, parseOnLoad: true"></script> |
| 24 | |
| 25 | <script type="text/javascript"> |
| 26 | dojo.require("dijit.dijit"); // optimize: load dijit layer |
| 27 | dojo.require("dojox.grid.DataGrid"); |
| 28 | dojo.require("dojo.data.ItemFileWriteStore"); |
| 29 | dojo.require("dijit.layout.BorderContainer"); |
| 30 | dojo.require("dijit.layout.ContentPane"); |
| 31 | dojo.require("dojo.parser"); |
| 32 | |
| 33 | |
| 34 | // ========================================================================== |
| 35 | // Grid structure |
| 36 | // ========================================================================== |
| 37 | gridLayout = { |
| 38 | defaultCell: { width: 8, editable: true, styles: 'text-align: right;' }, |
| 39 | cells: [ |
| 40 | { name: 'Id', width: 3, field: 'id' }, |
| 41 | { name: 'Priority', field: 'col1', styles: 'text-align: center;', type: dojox.grid.cells.Select, options: ["normal", "note", "important"]}, |
| 42 | { name: 'Mark', field: 'col2', width: 3, styles: 'text-align: center;', type: dojox.grid.cells.Bool }, |
| 43 | { name: 'Status', field: 'col3', styles: 'text-align: center;', type: dojox.grid.cells.Select, options: [ "new", "read", "replied" ]}, |
| 44 | { name: 'Message', field: 'col4', styles: '', width: '100%' }, |
| 45 | { name: 'Amount', field: 'col5'} |
| 46 | ] |
| 47 | }; |
| 48 | </script> |
| 49 | <script type="text/javascript" src="support/test_data.js"></script> |
| 50 | </head> |
| 51 | <body class="tundra"> |
| 52 | <div dojoType="dijit.layout.BorderContainer" liveSplitters="false" persist="true" |
| 53 | id="verticalSplitParam" design="headline" style="width: 100%; height: 100%;"> |
| 54 | |
| 55 | <div dojoType="dijit.layout.ContentPane" id="mybuttons" |
| 56 | region="top" splitter="false"> |
| 57 | <button onclick="grid.render()">Refresh</button> |
| 58 | <button onclick="grid.edit.focusEditor()">Focus Editor</button> |
| 59 | <button onclick="grid.focus.next()">Next Focus</button> |
| 60 | <button onclick="addRow()">Add Row</button> |
| 61 | <button onclick="grid.removeSelectedRows()">Remove</button> |
| 62 | <button onclick="grid.edit.apply()">Apply</button> |
| 63 | <button onclick="grid.edit.cancel()">Cancel</button> |
| 64 | <button onclick="grid.singleClickEdit = !grid.singleClickEdit">Toggle singleClickEdit</button> |
| 65 | </div> |
| 66 | |
| 67 | <div data-dojo-id="grid" class="myGrid" dojoType="dojox.grid.DataGrid" store="test_store" structure="gridLayout" |
| 68 | region="center"> |
| 69 | </div> |
| 70 | |
| 71 | <div data-dojo-id="gridBottom" class="myGrid" dojoType="dojox.grid.DataGrid" store="test_store" structure="gridLayout" |
| 72 | region="bottom" splitter="true" style="height: 100px;"> |
| 73 | </div> |
| 74 | |
| 75 | </div> |
| 76 | |
| 77 | </body> |
| 78 | </html> |