| 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>dojox.Grid with Dojo.Data via binding</title>
|
|
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
|
|
6 |
<style type="text/css">
|
|
|
7 |
@import "../../../dojo/resources/dojo.css";
|
|
|
8 |
@import "../_grid/tundraGrid.css";
|
|
|
9 |
|
|
|
10 |
#grid, #grid2 {
|
|
|
11 |
width: 65em;
|
|
|
12 |
height: 25em;
|
|
|
13 |
padding: 1px;
|
|
|
14 |
}
|
|
|
15 |
</style>
|
|
|
16 |
<script type="text/javascript" src="../../../dojo/dojo.js"
|
|
|
17 |
djConfig="isDebug: true, debugAtAllCosts: false, parseOnLoad: true"></script>
|
|
|
18 |
<script type="text/javascript">
|
|
|
19 |
dojo.require("dojox.grid.Grid");
|
|
|
20 |
dojo.require("dojox.grid._data.model");
|
|
|
21 |
dojo.require("dojo.data.ItemFileReadStore");
|
|
|
22 |
dojo.require("dojox.data.CsvStore");
|
|
|
23 |
dojo.require("dojo.parser");
|
|
|
24 |
</script>
|
|
|
25 |
<script type="text/javascript">
|
|
|
26 |
function getRow(inRowIndex){
|
|
|
27 |
return ' ' + inRowIndex;
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
var layoutMovies = [
|
|
|
31 |
// view 0
|
|
|
32 |
{ type: 'dojox.GridRowView', width: '20px' },
|
|
|
33 |
// view 1
|
|
|
34 |
{ cells: [[{ name: "Row", get: getRow, width: 5}]], noscroll: true},
|
|
|
35 |
// view 2
|
|
|
36 |
{ cells: [[
|
|
|
37 |
{ field: "Title", width: 'auto' },
|
|
|
38 |
{ field: "Year", width: 5 },
|
|
|
39 |
{ field: "Producer", width: 20 }
|
|
|
40 |
]]}
|
|
|
41 |
];
|
|
|
42 |
|
|
|
43 |
var layoutCountries = [
|
|
|
44 |
// view 0
|
|
|
45 |
{ type: 'dojox.GridRowView', width: '20px' },
|
|
|
46 |
// view 1
|
|
|
47 |
{ cells: [[{ name: "Row", get: getRow, width: 5}]], noscroll: true},
|
|
|
48 |
// view 2
|
|
|
49 |
{ cells: [[
|
|
|
50 |
{ field: 0, width: 'auto' },
|
|
|
51 |
{ width: 8 }
|
|
|
52 |
]]}
|
|
|
53 |
];
|
|
|
54 |
</script>
|
|
|
55 |
</head>
|
|
|
56 |
<body class="tundra">
|
|
|
57 |
<h5>dojox.Grid using Dojo.Data stores via simple binding</h5>
|
|
|
58 |
<span dojoType="dojox.data.CsvStore"
|
|
|
59 |
jsId="csvStore" url="support/movies.csv">
|
|
|
60 |
</span>
|
|
|
61 |
<span dojoType="dojox.grid.data.DojoData"
|
|
|
62 |
jsId="dataModel"
|
|
|
63 |
store="csvStore"
|
|
|
64 |
rowsPerPage="5"
|
|
|
65 |
query="{ Title: '*' }"
|
|
|
66 |
clientSort="true">
|
|
|
67 |
</span>
|
|
|
68 |
<div id="grid" dojoType="dojox.Grid" elasticView="2"
|
|
|
69 |
model="dataModel" structure="layoutMovies">
|
|
|
70 |
</div>
|
|
|
71 |
|
|
|
72 |
<span dojoType="dojo.data.ItemFileReadStore"
|
|
|
73 |
jsId="jsonStore" url="../../../dijit/tests/_data/countries.json">
|
|
|
74 |
</span>
|
|
|
75 |
<span dojoType="dojox.grid.data.DojoData"
|
|
|
76 |
jsId="dataModel2"
|
|
|
77 |
rowsPerPage="20"
|
|
|
78 |
store="jsonStore"
|
|
|
79 |
query="{ name : '*' }">
|
|
|
80 |
</span>
|
|
|
81 |
<div id="grid2" dojoType="dojox.Grid" elasticView="2"
|
|
|
82 |
model="dataModel2" structure="layoutCountries">
|
|
|
83 |
</div>
|
|
|
84 |
</body>
|
|
|
85 |
</html>
|