| 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 Grid Messaging - autoHeight</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: 65em; |
| 21 | padding: 1px; |
| 22 | } |
| 23 | </style> |
| 24 | <script type="text/javascript" src="../../../dojo/dojo.js" |
| 25 | data-dojo-config="isDebug:false, parseOnLoad: true"></script> |
| 26 | <script type="text/javascript"> |
| 27 | dojo.require("dijit.dijit"); // optimize: load dijit layer |
| 28 | dojo.require("dojox.grid.DataGrid"); |
| 29 | dojo.require("dojo.data.ItemFileWriteStore"); |
| 30 | dojo.require("dojo.parser"); |
| 31 | |
| 32 | dojo.declare("dojox.grid.SlowFileWriteStore", dojo.data.ItemFileWriteStore, { |
| 33 | _fetchItems: function( /*Object*/ keywordArgs, |
| 34 | /*Function*/ findCallback, |
| 35 | /*Function*/ errorCallback){ |
| 36 | setTimeout(dojo.hitch(this, function(){ |
| 37 | dojo.data.ItemFileWriteStore.prototype._fetchItems.call(this, keywordArgs, findCallback, errorCallback); |
| 38 | }), 10000); |
| 39 | } |
| 40 | }); |
| 41 | </script> |
| 42 | <script type="text/javascript" src="support/test_data.js"></script> |
| 43 | </head> |
| 44 | <body class="tundra"> |
| 45 | <span dojoType="dojo.data.ItemFileWriteStore" |
| 46 | data-dojo-id="jsonStore" url="../../../dijit/tests/_data/countries.json"> |
| 47 | </span> |
| 48 | <span dojoType="dojox.grid.SlowFileWriteStore" |
| 49 | data-dojo-id="jsonStore1" url="../../../dijit/tests/_data/countries.json"> |
| 50 | </span> |
| 51 | <span dojoType="dojo.data.ItemFileWriteStore" |
| 52 | data-dojo-id="jsonStore2" url="../../../dijit/tests/_data/countries-no.json"> |
| 53 | </span> |
| 54 | <div class="heading">Grid Messaging Test - Standard</div> |
| 55 | <table dojoType="dojox.grid.DataGrid" |
| 56 | data-dojo-id="grid" id="grid" class="grid" autoHeight="true" |
| 57 | store="jsonStore" query="{ name: 'A*' }" rowsPerPage="20" rowSelector="20px"> |
| 58 | <thead> |
| 59 | <tr> |
| 60 | <th field="name" width="300px">Country/Continent Name</th> |
| 61 | <th field="type" width="auto">Type</th> |
| 62 | </tr> |
| 63 | </thead> |
| 64 | </table><br> |
| 65 | <div class="heading">Grid Messaging Test - Loading</div> |
| 66 | <table dojoType="dojox.grid.DataGrid" |
| 67 | data-dojo-id="grid1" id="grid1" class="grid" autoHeight="true" |
| 68 | store="jsonStore1" query="{ name: 'A*' }" rowsPerPage="20" rowSelector="20px"> |
| 69 | <thead> |
| 70 | <tr> |
| 71 | <th field="name" width="300px">Country/Continent Name</th> |
| 72 | <th field="type" width="auto">Type</th> |
| 73 | </tr> |
| 74 | </thead> |
| 75 | </table><br> |
| 76 | <div class="heading">Grid Messaging Test - Empty</div> |
| 77 | <table dojoType="dojox.grid.DataGrid" |
| 78 | data-dojo-id="grid2" id="grid2" class="grid" autoHeight="true" |
| 79 | store="jsonStore" query="{ name: 'nonexist' }" rowsPerPage="20" rowSelector="20px"> |
| 80 | <thead> |
| 81 | <tr> |
| 82 | <th field="name" width="300px">Country/Continent Name</th> |
| 83 | <th field="type" width="auto">Type</th> |
| 84 | </tr> |
| 85 | </thead> |
| 86 | </table> |
| 87 | <div class="heading">Grid Messaging Test - Error</div> |
| 88 | <table dojoType="dojox.grid.DataGrid" |
| 89 | data-dojo-id="grid3" id="grid3" class="grid" autoHeight="true" |
| 90 | store="jsonStore2" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 91 | <thead> |
| 92 | <tr> |
| 93 | <th field="name" width="300px">Country/Continent Name</th> |
| 94 | <th field="type" width="auto">Type</th> |
| 95 | </tr> |
| 96 | </thead> |
| 97 | </table> |
| 98 | </body> |
| 99 | </html> |