2150 |
mathias |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
2 |
<html>
|
|
|
3 |
<head>
|
|
|
4 |
<title>Test dojox.Grid Basic</title>
|
|
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
|
|
6 |
<style type="text/css">
|
|
|
7 |
@import "../_grid/Grid.css";
|
|
|
8 |
body {
|
|
|
9 |
font-size: 0.9em;
|
|
|
10 |
font-family: Geneva, Arial, Helvetica, sans-serif;
|
|
|
11 |
}
|
|
|
12 |
.heading {
|
|
|
13 |
font-weight: bold;
|
|
|
14 |
padding-bottom: 0.25em;
|
|
|
15 |
}
|
|
|
16 |
|
|
|
17 |
#grid {
|
|
|
18 |
border: 1px solid #333;
|
|
|
19 |
width: 35em;
|
|
|
20 |
height: 30em;
|
|
|
21 |
}
|
|
|
22 |
</style>
|
|
|
23 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script>
|
|
|
24 |
<!--<script type="text/javascript">
|
|
|
25 |
dojo.require("dojox.grid.Grid");
|
|
|
26 |
dojo.require("dojox.grid._data.model");
|
|
|
27 |
dojo.require("dojo.parser");
|
|
|
28 |
</script>-->
|
|
|
29 |
<!-- Debugging -->
|
|
|
30 |
<script type="text/javascript" src="../_grid/lib.js"></script>
|
|
|
31 |
<script type="text/javascript" src="../_grid/drag.js"></script>
|
|
|
32 |
<script type="text/javascript" src="../_grid/scroller.js"></script>
|
|
|
33 |
<script type="text/javascript" src="../_grid/builder.js"></script>
|
|
|
34 |
<script type="text/javascript" src="../_grid/cell.js"></script>
|
|
|
35 |
<script type="text/javascript" src="../_grid/layout.js"></script>
|
|
|
36 |
<script type="text/javascript" src="../_grid/rows.js"></script>
|
|
|
37 |
<script type="text/javascript" src="../_grid/focus.js"></script>
|
|
|
38 |
<script type="text/javascript" src="../_grid/selection.js"></script>
|
|
|
39 |
<script type="text/javascript" src="../_grid/edit.js"></script>
|
|
|
40 |
<script type="text/javascript" src="../_grid/view.js"></script>
|
|
|
41 |
<script type="text/javascript" src="../_grid/views.js"></script>
|
|
|
42 |
<script type="text/javascript" src="../_grid/rowbar.js"></script>
|
|
|
43 |
<script type="text/javascript" src="../_grid/publicEvents.js"></script>
|
|
|
44 |
<script type="text/javascript" src="../VirtualGrid.js"></script>
|
|
|
45 |
<script type="text/javascript" src="../_data/fields.js"></script>
|
|
|
46 |
<script type="text/javascript" src="../_data/model.js"></script>
|
|
|
47 |
<script type="text/javascript" src="../_data/editors.js"></script>
|
|
|
48 |
<script type="text/javascript" src="../Grid.js"></script>
|
|
|
49 |
<script type="text/javascript" src="support/test_data.js"></script>
|
|
|
50 |
<script type="text/javascript">
|
|
|
51 |
// a grid view is a group of columns
|
|
|
52 |
var view1 = {
|
|
|
53 |
cells: [[
|
|
|
54 |
{name: 'Column 0'}, {name: 'Column 1'}, {name: 'Column 2'}, {name: 'Column 3', width: "150px"}, {name: 'Column 4'},
|
|
|
55 |
{name: 'Column 5'}, {name: 'Column 6'}, {name: 'Column 7', field: 0}, {name: 'Column 8'},
|
|
|
56 |
{name: 'Column 9'}, {name: 'Column 10'}, {name: 'Column 11', field: 0}, {name: 'Column 12', width: "150px"}, {name: 'Column 13'},
|
|
|
57 |
{name: 'Column 14'}, {name: 'Column 15'}, {name: 'Column 16', field: 0}, {name: 'Column 17'}
|
|
|
58 |
]]
|
|
|
59 |
};
|
|
|
60 |
// a grid layout is an array of views.
|
|
|
61 |
var layout = [ view1 ];
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
function keyDown(e) {
|
|
|
65 |
switch(e.keyCode){
|
|
|
66 |
case dojo.keys.LEFT_ARROW:
|
|
|
67 |
console.log('left arrow!');
|
|
|
68 |
break;
|
|
|
69 |
case dojo.keys.RIGHT_ARROW:
|
|
|
70 |
console.log('right arrow!');
|
|
|
71 |
break;
|
|
|
72 |
case dojo.keys.ENTER:
|
|
|
73 |
console.log('enter!');
|
|
|
74 |
break;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
dojo.addOnLoad(function() {
|
|
|
81 |
window["grid"] = dijit.byId("grid");
|
|
|
82 |
dojo.connect(grid, "onKeyDown", keyDown);
|
|
|
83 |
});
|
|
|
84 |
|
|
|
85 |
</script>
|
|
|
86 |
</head>
|
|
|
87 |
<body>
|
|
|
88 |
<div class="heading">dojox.Grid Basic Test</div>
|
|
|
89 |
<div id="grid" dojoType="dojox.Grid" model="model" structure="layout"></div>
|
|
|
90 |
</body>
|
|
|
91 |
</html>
|