Updated
This commit is contained in:
113
master/examples/test_data_grid_relWidth.html
Normal file
113
master/examples/test_data_grid_relWidth.html
Normal file
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Test dojox.grid.DataGrid Relative Width</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";
|
||||
body {
|
||||
font-size: 0.9em;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.heading {
|
||||
font-weight: bold;
|
||||
padding-bottom: 0.25em;
|
||||
}
|
||||
.grid {
|
||||
width: 85%;
|
||||
height: 20em;
|
||||
padding: 1px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../../../dojo/dojo.js"
|
||||
djConfig="isDebug:false, parseOnLoad: true"></script>
|
||||
<script type="text/javascript">
|
||||
dojo.require("dijit.dijit");
|
||||
dojo.require("dojox.grid.DataGrid");
|
||||
dojo.require("dojo.data.ItemFileWriteStore");
|
||||
dojo.require("dojo.parser");
|
||||
|
||||
dojo.addOnLoad(function(){
|
||||
// A quick-and-dirty resize of the grid when the window resizes to
|
||||
// test that percentages "stick" when they are supposed to.
|
||||
dojo.connect(window, "resize", grid, "resize");
|
||||
dojo.connect(window, "resize", grid1, "resize");
|
||||
dojo.connect(window, "resize", grid2, "resize");
|
||||
dojo.connect(window, "resize", grid3, "resize");
|
||||
dojo.connect(window, "resize", grid4, "resize");
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="support/test_data.js"></script>
|
||||
</head>
|
||||
<body class="tundra">
|
||||
<div class="heading">dojox.grid.DataGrid Relative Width Test</div>
|
||||
<span dojoType="dojo.data.ItemFileWriteStore"
|
||||
jsId="jsonStore" url="../../../dijit/tests/_data/countries.json">
|
||||
</span>
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
jsid="grid" id="grid" class="grid"
|
||||
store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="name" relWidth="3">Country/Continent Name</th>
|
||||
<th field="type" relWidth="1">Type</th>
|
||||
<th field="population" relWidth="1">Population</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="heading">Relwidth mixed with %</div>
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
jsid="grid1" id="grid1" class="grid"
|
||||
store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="name" relWidth="3">Country/Continent Name</th>
|
||||
<th field="type" relWidth="1">Type</th>
|
||||
<th field="population" width="25%">Population</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="heading">Relwidth mixed with static values</div>
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
jsid="grid2" id="grid2" class="grid"
|
||||
store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="name" relWidth="3">Country/Continent Name</th>
|
||||
<th field="type" relWidth="1">Type</th>
|
||||
<th field="population" width="20em">Population</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="heading">Relwidth mixed with auto (relwidth not used)</div>
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
jsid="grid3" id="grid3" class="grid"
|
||||
store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="name" width="auto">Country/Continent Name</th>
|
||||
<th field="type" relWidth="1">Type</th>
|
||||
<th field="population" relWidth="2">Population</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="heading">Relwidth with colspans</div>
|
||||
<table dojoType="dojox.grid.DataGrid"
|
||||
jsid="grid4" id="grid4" class="grid"
|
||||
store="jsonStore" query="{ name: '*' }" rowsPerPage="20" rowSelector="20px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="type" relWidth="1">Type</th>
|
||||
<th field="population" relWidth="2">Population</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th field="name" relWidth="1" colspan="2">Country/Continent Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user