I created a sample.js under /js/test/grid/grid_definitions/sample.js and my dojo root directory is at /js/dojo/dojo/dojo.js
dojo.provide("test.grid.grid_definitions.sample");
(function(){
test.grid.grid_definitions.sample.structure = [{
cells: [[{
name: 'Dow',
width:"auto",
rowSpan: 2,
field: "dow"
}, {
name: 'Stay Date',
width:"auto",
rowSpan: 2,
field: "staydate"
}, {
name: 'T1 (1-6)',
width:"auto"
}, {
name: 'T2 (7-13)',
width:"auto",
colSpan: 2
}, {
name: 'T3 (14-20)',
width:"auto",
colSpan: 2
}, {
name: 'T4 (21-27)',
width:'auto'
}, {
name: 'T5 (28-34)',
width:"auto",
}, {
name: 'T6 (35-KDATE)',
width:"auto",
colSpan: 2
}], [{
name: 'Current',
width:"auto",
field: "t1_current"
}, {
name: 'Cal/Over',
width:"auto",
field: "t2_cal"
}, {
name: 'INC or %',
width:"auto",
field: "t2_inc"
}, {
name: 'Cal/Over',
width:"auto",
field: "t3_cal"
}, {
name: 'INC or %',
width:"auto",
field: "t3_inc"
}, {
name: 'Cal/Over',
width:"auto",
field: "t4_cal"
}, {
name: 'Cal/Over',
width:"auto",
field: "t5_cal"
}, {
name: 'Cal/Over',
width:"auto",
field: "t6_cal"
}, {
name: 'INC or %',
width:"auto",
field: "t6_inc"
}, ]]
}];
})();And my sample json data at the root /sample.json
{ identifier: "id",
label: "id",
items:
[
{ id:1,
dow:"Sun",
staydate:"1-Jun-08",
t1_current:"169.00",
t2_cal:"152.00",
t2_inc:"(10%)",
t3_cal:"152.00",
t3_inc:"(10%)",
t4_cal:"152.00",
t5_cal:"152.00",
t6_cal:"152.00",
t6_inc:""
}
]
}also in my html i add the following
<script type="text/javascript">
dojo.registerModulePath("test","../../test");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojox.grid.Grid");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("test.grid.grid_definitions.sample");
dojo.require("dojo.parser");
</script>and my grid as follows
<div id="data">
<span dojoType="dojo.data.ItemFileReadStore" jsId="sampleStore" url="/sample.json"></span>
<div id="data_grid" dojoType="dojox.grid.Grid" jsId="sampleGrid" store="sampleStore"
structure="test.grid.grid_definitions.sample.structure"></div>
<div dojoType="dijit.form.FilteringSelect" store="sampleStore" labelAttr="id"
searchAttr="id" name="id"/></div>
</div>Initially I thought my store is messed-up, but I added Select box to check if its working and it works. So the dataStore is good. I have two problems right now.
On FireFox (2.0) - the grid shows up with the header (and no data in it)
On IE (6.0) - I don't see a grid and getting following error
failed loading lib/dojo/../test/grid/grid_definitions/sample.js with error: [object Error]
I am read the documentation and following examples - http://api.dojotoolkit.org/jsdoc/dojo/HEAD/dojo.registerModulePath and trying post issues, but no response.
I am stuck. I have to evaluate dojo grids for our new project. Please help!!!

Some hints
Hmm, the title of your post is not going to ensure you get a response quickly... quite the opposite, I would guess.
Well if it helps, I pared down your example and got it to work by tweaking a couple of things. I would suggest starting with this code below and then adding to it incrementally to add all of the functionality you want. Note that I changed the grid to a dojox.grid.DataGrid, but I think your problems arose from the format of your json file (not sure, but the stores seem to require quotes around the item keys) and the fact that you had no query or items specified in your grid declaration (one or the other is required, I believe):
script:
dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.parser"); var sampleLayout = [ { name: 'Dow', width:"auto", field: "dow" }];body:
sample.json:
{ 'identifier': "id", 'label': "id", 'items': [ { 'id':1, 'dow':"Sun", 'staydate':"1-Jun-08", 't1_current':"169.00", 't2_cal':"152.00", 't2_inc':"(10%)", 't3_cal':"152.00", 't3_inc':"(10%)", 't4_cal':"152.00", 't5_cal':"152.00", 't6_cal':"152.00", 't6_inc':"" } ] }forum keeps messing up my example...
<div dojoType="dojo.data.ItemFileReadStore" jsId="sampleStore" url="media/json/sample.json"></div>
<div id="data_grid" dojoType="dojox.grid.DataGrid" store="sampleStore"
query="{id: '*}" jsId="sampleGrid" structure="sampleLayout"></div>