| 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.DataGrid Relative Width</title> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> |
| 7 | <style type="text/css"> |
| 8 | @import "../../../dojo/resources/dojo.css"; |
| 9 | @import "../resources/Grid.css"; |
| 10 | @import "../resources/tundraGrid.css"; |
| 11 | body { |
| 12 | font-size: 0.9em; |
| 13 | font-family: Geneva, Arial, Helvetica, sans-serif; |
| 14 | } |
| 15 | .heading { |
| 16 | font-weight: bold; |
| 17 | padding-bottom: 0.25em; |
| 18 | } |
| 19 | .grid { |
| 20 | width: 85%; |
| 21 | height: 20em; |
| 22 | padding: 1px; |
| 23 | } |
| 24 | </style> |
| 25 | <script type="text/javascript" src="../../../dojo/dojo.js" |
| 26 | data-dojo-config="isDebug:false, parseOnLoad: true"></script> |
| 27 | <script type="text/javascript"> |
| 28 | dojo.require("dijit.dijit"); |
| 29 | dojo.require("dojox.grid.DataGrid"); |
| 30 | dojo.require("dojo.data.ItemFileWriteStore"); |
| 31 | dojo.require("dojo.parser"); |
| 32 | |
| 33 | dojo.addOnLoad(function(){ |
| 34 | // A quick-and-dirty resize of the grid when the window resizes to |
| 35 | // test that percentages "stick" when they are supposed to. |
| 36 | dojo.connect(window, "resize", grid, "resize"); |
| 37 | dojo.connect(window, "resize", grid1, "resize"); |
| 38 | dojo.connect(window, "resize", grid2, "resize"); |
| 39 | dojo.connect(window, "resize", grid3, "resize"); |
| 40 | dojo.connect(window, "resize", grid4, "resize"); |
| 41 | }); |
| 42 | </script> |
| 43 | <script type="text/javascript" src="support/test_data.js"></script> |
| 44 | </head> |
| 45 | <body class="tundra"> |
| 46 | <div class="heading">dojox.grid.DataGrid Relative Width Test</div> |
| 47 | <span dojoType="dojo.data.ItemFileWriteStore" |
| 48 | data-dojo-id="jsonStore" url="../../../dijit/tests/_data/countries.json"> |
| 49 | </span> |
| 50 | <table dojoType="dojox.grid.DataGrid" |
| 51 | data-dojo-id="grid" id="grid" class="grid" |
| 52 | store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 53 | <thead> |
| 54 | <tr> |
| 55 | <th field="name" relWidth="3">Country/Continent Name</th> |
| 56 | <th field="type" relWidth="1">Type</th> |
| 57 | <th field="population" relWidth="1">Population</th> |
| 58 | </tr> |
| 59 | </thead> |
| 60 | </table> |
| 61 | <div class="heading">Relwidth mixed with %</div> |
| 62 | <table dojoType="dojox.grid.DataGrid" |
| 63 | data-dojo-id="grid1" id="grid1" class="grid" |
| 64 | store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 65 | <thead> |
| 66 | <tr> |
| 67 | <th field="name" relWidth="3">Country/Continent Name</th> |
| 68 | <th field="type" relWidth="1">Type</th> |
| 69 | <th field="population" width="25%">Population</th> |
| 70 | </tr> |
| 71 | </thead> |
| 72 | </table> |
| 73 | <div class="heading">Relwidth mixed with static values</div> |
| 74 | <table dojoType="dojox.grid.DataGrid" |
| 75 | data-dojo-id="grid2" id="grid2" class="grid" |
| 76 | store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 77 | <thead> |
| 78 | <tr> |
| 79 | <th field="name" relWidth="3">Country/Continent Name</th> |
| 80 | <th field="type" relWidth="1">Type</th> |
| 81 | <th field="population" width="20em">Population</th> |
| 82 | </tr> |
| 83 | </thead> |
| 84 | </table> |
| 85 | <div class="heading">Relwidth mixed with auto (relwidth not used)</div> |
| 86 | <table dojoType="dojox.grid.DataGrid" |
| 87 | data-dojo-id="grid3" id="grid3" class="grid" |
| 88 | store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 89 | <thead> |
| 90 | <tr> |
| 91 | <th field="name" width="auto">Country/Continent Name</th> |
| 92 | <th field="type" relWidth="1">Type</th> |
| 93 | <th field="population" relWidth="2">Population</th> |
| 94 | </tr> |
| 95 | </thead> |
| 96 | </table> |
| 97 | <div class="heading">Relwidth with colspans</div> |
| 98 | <table dojoType="dojox.grid.DataGrid" |
| 99 | data-dojo-id="grid4" id="grid4" class="grid" |
| 100 | store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 101 | <thead> |
| 102 | <tr> |
| 103 | <th field="type" relWidth="1">Type</th> |
| 104 | <th field="population" relWidth="2">Population</th> |
| 105 | </tr> |
| 106 | <tr> |
| 107 | <th field="name" relWidth="1" colspan="2">Country/Continent Name</th> |
| 108 | </tr> |
| 109 | </thead> |
| 110 | </table> |
| 111 | </body> |
| 112 | </html> |
| 113 |