//Create data store and bind to grid. store = new dojo.data.ItemFileReadStore({ data:data }); var grid = dijit.byId('grid'); grid.setStore(store);
dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.data.ItemFileReadStore");
<script>var dojoConfig = { parseOnLoad:true }</script>
I would reccomend that you ensure that the HTML is set up correctly so that the grid renders correctly. Sometimes things fail and you may not even know that the grid never really did get instantiated correctly. Here is a sample of how I create the grid in-line HTML code, basically it is a similar example to what ESRI suggestes. this came out of some testing that I was doing. Note that I am using "dojoType="dojox.grid.DataGrid" jsid="grid" slightly different than you are.
<div dojotype="dijit.layout.ContentPane" region="left" style="width:300px">
<table dojoType="dojox.grid.DataGrid" jsid="grid" id="grid" rowsPerPage="5" rowSelector="20px" style="height:300px; width:250px">
<thead>
<tr>
<th field="OBJECTID" width="20px">ID</th>
<th field="PERMANENT_IDENTIFIER" width="100px">PermID</th>
<th field="META_PROCESSID" width="100px">MetaProcessID</th>
</tr>
</thead>
</table>
</div>
To gain access to your Dojo widget you should only have to require the appropriate dojo libraries/modules (if you are not using the AMD notation)
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileReadStore");
Then you can get the widget by using the following code in your JS page or script block.
var grid = dijit.byId('grid');
Note that you will need to make sure that all your HTML renders correctly in order for everything to work correctly. I have encountered situations where I thought it was the code for the Grid for example but it turns out that the HTML before that was failing and therefore not all the objects were getting set as I expected. Use something like firebug to ensure that there are no load errors on your page.
Good Luck and hope this helps in some sort of way.
Diana
I got the same problem, any luck on you end?
Dave