Example DataGrid with Non-Resizable Columns
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/Grid.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/tundraGrid.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/resources/dojo.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/tundra/tundra.css">
<div class="tundra">
<div class="heading">dojox.grid.Grid Basic Test</div>
<div jsId="grid" id="grid" dojoType="dojox.grid.DataGrid"
store="test_store" query="{ id: '*' }"
structure="layout" rowSelector="20px"></div>
</div>
CSS
body {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.heading {
font-weight: bold;
padding-bottom: 0.25em;
}
#grid {
border: 1px solid #333;
width: 90%;
height: 30em;
}
JavaScript
dojo.require("dijit.dijit");
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dojo.parser");
var test_store;
var layout = [
{
name: 'Column 1',
field: 'col1',
noresize: true},
{
name: 'Column 2',
field: 'col2',
noresize: true},
{
name: 'Column 3',
field: 'col3',
noresize: true},
{
name: 'Column 4',
field: 'col4',
width: "100px",
noresize: true},
{
name: 'Column 5',
field: 'col5',
noresize: true}
];
// example sample data and code
dojo.addOnLoad(function() {
// some sample data
// global var "data"
data = {
identifier: 'id',
label: 'id',
items: []
};
data_list = [
{
col1: "normal",
col2: false,
col3: "new",
col4: 'But are not followed by two hexadecimal',
col5: 29.91,
col6: 10,
col7: false},
{
col1: "important",
col2: false,
col3: "new",
col4: 'Because a % sign always indicates',
col5: 9.33,
col6: -5,
col7: false},
{
col1: "important",
col2: false,
col3: "read",
col4: 'Signs can be selectively',
col5: 19.34,
col6: 0,
col7: true},
{
col1: "note",
col2: false,
col3: "read",
col4: 'However the reserved characters',
col5: 15.63,
col6: 0,
col7: true},
{
col1: "normal",
col2: false,
col3: "replied",
col4: 'It is therefore necessary',
col5: 24.22,
col6: 5.50,
col7: true},
{
col1: "important",
col2: false,
col3: "replied",
col4: 'To problems of corruption by',
col5: 9.12,
col6: -3,
col7: true},
{
col1: "note",
col2: false,
col3: "replied",
col4: 'Which would simply be awkward in',
col5: 12.15,
col6: -4,
...