Updated
This commit is contained in:
96
master/examples/test_markup.html
Normal file
96
master/examples/test_markup.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>dojox.grid.Grid with Dojo.Data via binding</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
||||
<style type="text/css">
|
||||
@import "../../../dojo/resources/dojo.css";
|
||||
@import "../resources/Grid.css";
|
||||
@import "../resources/tundraGrid.css";
|
||||
|
||||
#grid, #grid2 {
|
||||
width: 65em;
|
||||
height: 25em;
|
||||
padding: 1px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../../../dojo/dojo.js"
|
||||
djConfig="isDebug: true, debugAtAllCosts: false, parseOnLoad: true"></script>
|
||||
<script type="text/javascript">
|
||||
dojo.require("dijit.dijit");
|
||||
dojo.require("dojox.grid.DataGrid");
|
||||
dojo.require("dojo.data.ItemFileReadStore");
|
||||
dojo.require("dojox.data.CsvStore");
|
||||
dojo.require("dojo.parser");
|
||||
</script>
|
||||
</head>
|
||||
<body class="tundra">
|
||||
<h5>dojox.grid.Grid structure from markup</h5>
|
||||
<span dojoType="dojox.data.CsvStore"
|
||||
jsId="csvStore" url="support/movies.csv">
|
||||
</span>
|
||||
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
store="csvStore"
|
||||
query="{ Title: '*' }"
|
||||
clientSort="true"
|
||||
style="width: 800px; height: 300px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="300px" field="Title">Title of Movie</th>
|
||||
<th width="5em">Year</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">Producer</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
<span dojoType="dojo.data.ItemFileReadStore"
|
||||
jsId="jsonStore" url="../../../dijit/tests/_data/countries.json">
|
||||
</span>
|
||||
<h5>Locked views specified with tables and colgroups</h5>
|
||||
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
store="jsonStore"
|
||||
rowsPerPage="20"
|
||||
query="{ name: '*' }"
|
||||
style="width: 600px; height: 300px;"
|
||||
rowSelector="20px">
|
||||
<colgroup span="1" noscroll="true" width="300px"></colgroup>
|
||||
<colgroup span="4"></colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="name" width="auto">Country/Continent Name</th>
|
||||
<th width="100px" field="population">Population</th>
|
||||
<th width="100px" field="area">Land Mass</th>
|
||||
<th width="100px" field="timezone">Time Zone</th>
|
||||
<th width="5em" field="type">Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<h5>A "regular" Grid from markup (no table defintion)</h5>
|
||||
<script type="text/javascript">
|
||||
// helper functions and structure definitions for the old markup construction syntax
|
||||
var layoutCountries = [
|
||||
// view 1
|
||||
{
|
||||
cells: [ new dojox.grid.cells.RowIndex() ],
|
||||
noscroll: true
|
||||
},
|
||||
// view 2
|
||||
[
|
||||
{ field: 'name', width: 'auto' },
|
||||
{ field: 'type', width: 8 }
|
||||
]
|
||||
];
|
||||
</script>
|
||||
<div id="grid2" dojoType="dojox.grid.DataGrid" elasticView="2" query="{ name: '*' }"
|
||||
rowsPerPage="20" store="jsonStore" structure="layoutCountries" rowSelector="20px">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user