I've got a Dojo DataGrid defined in my HTML:
<table data-dojo-type="dojox.grid.DataGrid" data-dojo-id="mainTable">
<thead>
<tr>
<th field="id" width="128px">id</th>
<th field="foo" width="128px">foo</th>
<th field="bar" width="128px">bar</th>
<th field="baz" width="128px">baz</th>
</tr>
</thead>
</table>
and I've got a JavaScript function that tries to get a handle to this DataGrid and assign a model to it:
[...]
mainTable.setStore(new dojo.data.ItemFileWriteStore({ data : data }));
[...]
According to the Dojo docs, adding the data-dojo-id tag generates "a JavaScript variable that will be created that will hold the grid object. This can then be referenced in scripts." But my Chromium JS console complains "'mainTable' is undefined". So when is this variable created and what do I have to do before I can access it?