| 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 Notification</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, #grid2 { |
| 20 | width: 65em; |
| 21 | height: 25em; |
| 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 | </script> |
| 33 | <script type="text/javascript" src="support/test_data.js"></script> |
| 34 | </head> |
| 35 | <body class="tundra"> |
| 36 | <div class="heading">dojox.grid.DataGrid Notification Test</div> |
| 37 | <button onclick="updateCountryTypes();">Change country types</button> |
| 38 | <script> |
| 39 | function updateCountryTypes(){ |
| 40 | // get everything starting with "A" |
| 41 | jsonStore.fetch({ |
| 42 | query: { name: "A*" }, |
| 43 | onComplete: function(items, result){ |
| 44 | // change 'em! |
| 45 | dojo.forEach(items, function(item){ |
| 46 | jsonStore.setValue(item, "type", "thinger"); |
| 47 | // console.debug(item); |
| 48 | }); |
| 49 | } |
| 50 | }); |
| 51 | } |
| 52 | </script> |
| 53 | <span dojoType="dojo.data.ItemFileWriteStore" |
| 54 | data-dojo-id="jsonStore" url="../../../dijit/tests/_data/countries.json"> |
| 55 | </span> |
| 56 | <table dojoType="dojox.grid.DataGrid" |
| 57 | data-dojo-id="grid" id="grid" |
| 58 | store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px"> |
| 59 | <thead> |
| 60 | <tr> |
| 61 | <th field="name" width="300px">Country/Continent Name</th> |
| 62 | <th field="type" width="auto">Type</th> |
| 63 | </tr> |
| 64 | </thead> |
| 65 | </table> |
| 66 | </body> |
| 67 | </html> |