| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Dojox Store Explorer</title> |
| 5 | <style type="text/css"> |
| 6 | @import "../../../grid/resources/Grid.css"; |
| 7 | @import "../../../grid/resources/tundraGrid.css"; |
| 8 | @import "../../../../dojo/resources/dojo.css"; |
| 9 | @import "../../../../dijit/themes/tundra/tundra.css"; |
| 10 | @import "../../../../dijit/themes/tundra/tundra_rtl.css"; |
| 11 | @import "../../../../dijit/tests/css/dijitTests.css"; |
| 12 | #controls button { |
| 13 | margin-left: 10px; |
| 14 | } |
| 15 | #grid { |
| 16 | width: 850px; |
| 17 | height: 350px; |
| 18 | border: 1px solid silver; |
| 19 | } |
| 20 | </style> |
| 21 | |
| 22 | <script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script> |
| 23 | <script type="text/javascript"> |
| 24 | dojo.require("dojo.data.ItemFileWriteStore"); |
| 25 | dojo.require("dojox.data.StoreExplorer"); |
| 26 | dojo.require("dojo.parser"); gridLayout = [{ |
| 27 | defaultCell: { width: 8, editable: true, type: dojox.grid.cells._Widget, styles: 'text-align: right;' }, |
| 28 | rows: [ |
| 29 | { name: 'Id', field: 'id'} |
| 30 | ] |
| 31 | }]; |
| 32 | store = new dojo.data.ItemFileWriteStore({data: |
| 33 | { identifier: 'name', |
| 34 | label: 'name', |
| 35 | items: [ |
| 36 | { name:'Africa', type:'continent', population:'900 million', area: '30,221,532 sq km', |
| 37 | timezone: '-1 UTC to +4 UTC', |
| 38 | children:[{_reference:'Egypt'}, {_reference:'Kenya'}, {_reference:'Sudan'}] }, |
| 39 | { name:'Egypt', type:'country' }, |
| 40 | { name:'Kenya', type:'country', |
| 41 | children:[{_reference:'Nairobi'}, {_reference:'Mombasa'}] }, |
| 42 | { name:'Nairobi', type:'city' }, |
| 43 | { name:'Mombasa', type:'city' }, |
| 44 | { name:'Sudan', type:'country', |
| 45 | children:{_reference:'Khartoum'} }, |
| 46 | { name:'Khartoum', type:'city' }, |
| 47 | { name:'Asia', type:'continent', |
| 48 | children:[{_reference:'China'}, {_reference:'India'}, {_reference:'Russia'}, {_reference:'Mongolia'}] }, |
| 49 | { name:'China', type:'country' }, |
| 50 | { name:'India', type:'country' }, |
| 51 | { name:'Russia', type:'country' }, |
| 52 | { name:'Mongolia', type:'country' }, |
| 53 | { name:'Australia', type:'continent', population:'21 million', |
| 54 | children:{_reference:'Commonwealth of Australia'}}, |
| 55 | { name:'Commonwealth of Australia', type:'country', population:'21 million'}, |
| 56 | { name:'Europe', type:'continent', |
| 57 | children:[{_reference:'Germany'}, {_reference:'France'}, {_reference:'Spain'}, {_reference:'Italy'}] }, |
| 58 | { name:'Germany', type:'country' }, |
| 59 | { name:'France', type:'country' }, |
| 60 | { name:'Spain', type:'country' }, |
| 61 | { name:'Italy', type:'country' }, |
| 62 | { name:'North America', type:'continent', |
| 63 | children:[{_reference:'Mexico'}, {_reference:'Canada'}, {_reference:'United States of America'}] }, |
| 64 | { name:'Mexico', type:'country', population:'108 million', area:'1,972,550 sq km', |
| 65 | children:[{_reference:'Mexico City'}, {_reference:'Guadalajara'}] }, |
| 66 | { name:'Mexico City', type:'city', population:'19 million', timezone:'-6 UTC'}, |
| 67 | { name:'Guadalajara', type:'city', population:'4 million', timezone:'-6 UTC' }, |
| 68 | { name:'Canada', type:'country', population:'33 million', area:'9,984,670 sq km', |
| 69 | children:[{_reference:'Ottawa'}, {_reference:'Toronto'}] }, |
| 70 | { name:'Ottawa', type:'city', population:'0.9 million', timezone:'-5 UTC'}, |
| 71 | { name:'Toronto', type:'city', population:'2.5 million', timezone:'-5 UTC' }, |
| 72 | { name:'United States of America', type:'country' }, |
| 73 | { name:'South America', type:'continent', |
| 74 | children:[{_reference:'Brazil'}, {_reference:'Argentina'}] }, |
| 75 | { name:'Brazil', type:'country', population:'186 million' }, |
| 76 | { name:'Argentina', type:'country', population:'40 million' } |
| 77 | ]}}); |
| 78 | </script> |
| 79 | <body class="tundra"> |
| 80 | <h2>ItemFileWriteStore Explorer</h2> |
| 81 | <div dojoType="dojox.data.StoreExplorer" store="store" style="height:500px;width:100%;border:1px solid black" structure="gridLayout"></div> |
| 82 | </body> |
| 83 | </html> |