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.Grid Basic</title> |
---|
6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> |
---|
7 | <style type="text/css"> |
---|
8 | @import "../resources/Grid.css"; |
---|
9 | @import "../resources/tundraGrid.css"; |
---|
10 | @import "../../../dojo/resources/dojo.css"; |
---|
11 | @import "../../../dijit/themes/tundra/tundra.css"; |
---|
12 | body { |
---|
13 | font-size: 0.9em; |
---|
14 | font-family: Geneva, Arial, Helvetica, sans-serif; |
---|
15 | margin-left:5em; |
---|
16 | } |
---|
17 | .heading { |
---|
18 | font-weight: bold; |
---|
19 | padding-bottom: 0.25em; |
---|
20 | } |
---|
21 | |
---|
22 | #grid { |
---|
23 | border: 1px solid #333; |
---|
24 | width: 35em; |
---|
25 | height: 30em; |
---|
26 | } |
---|
27 | </style> |
---|
28 | <script type="text/javascript" src="../../../dojo/dojo.js" |
---|
29 | data-dojo-config="isDebug:true, parseOnLoad: true"></script> |
---|
30 | <script type="text/javascript"> |
---|
31 | dojo.require("dijit.dijit"); |
---|
32 | dojo.require("dojox.grid.DataGrid"); |
---|
33 | dojo.require("dojo.data.ItemFileWriteStore"); |
---|
34 | dojo.require("dojo.parser"); |
---|
35 | </script> |
---|
36 | <script type="text/javascript" src="support/test_data.js"></script> |
---|
37 | <script type="text/javascript"> |
---|
38 | var layout = [ |
---|
39 | {name: 'Column 1', field: 'col1'}, |
---|
40 | {name: 'Column 2', field: 'col2'}, |
---|
41 | {name: 'Column 3', field: 'col3'}, |
---|
42 | {name: 'Column 4', field: 'col4', width: "150px"}, |
---|
43 | {name: 'Column 5', field: 'col5'}, |
---|
44 | {name: 'Column 6', field: 'col6'}, |
---|
45 | {name: 'Column 7', field: 'col7'}, |
---|
46 | {name: 'Column 8'}, |
---|
47 | {name: 'Column 9', field: 'col3'}, |
---|
48 | {name: 'Column 10', field: 'col1'}, |
---|
49 | {name: 'Column 11', field: 'col2'}, |
---|
50 | {name: 'Column 12', field: 'col3'}, |
---|
51 | {name: 'Column 13', field: 'col4', width: "150px"}, |
---|
52 | {name: 'Column 14', field: 'col5'}, |
---|
53 | {name: 'Column 15', field: 'col6'}, |
---|
54 | {name: 'Column 16', field: 'col7'}, |
---|
55 | {name: 'Column 17'}, |
---|
56 | {name: 'Column 18', field: 'col3'} |
---|
57 | ]; |
---|
58 | |
---|
59 | function keyDown(e) { |
---|
60 | switch(e.keyCode){ |
---|
61 | case dojo.keys.LEFT_ARROW: |
---|
62 | console.log('left arrow!'); |
---|
63 | break; |
---|
64 | case dojo.keys.RIGHT_ARROW: |
---|
65 | console.log('right arrow!'); |
---|
66 | break; |
---|
67 | case dojo.keys.ENTER: |
---|
68 | console.log('enter!'); |
---|
69 | break; |
---|
70 | } |
---|
71 | } |
---|
72 | </script> |
---|
73 | </head> |
---|
74 | <body class="tundra"> |
---|
75 | <div class="heading" tabindex="0">dojox.grid.Grid Basic Test</div> |
---|
76 | <div id="grid" data-dojo-id="grid" dojoType="dojox.grid.DataGrid" |
---|
77 | store="test_store" structure="layout"> |
---|
78 | <script type="dojo/connect" data-dojo-event="onKeyDown" data-dojo-args="e"> |
---|
79 | keyDown(e); |
---|
80 | </script> |
---|
81 | </div> |
---|
82 | <p id="p-after-grid" tabindex="0">Tab-focusable paragraph below the grid</p> |
---|
83 | </body> |
---|
84 | </html> |
---|