views:

143

answers:

1

Hi,

Trying to get a Dojo datagrid working - have duplicated the first example on the documentation page (http://docs.dojocampus.org/dojox/grid/DataGrid) & it works just fine.

However, when I try to display the grid inside another div (i.e. putting 'gridContainer4' from the example inside any other div) nothing displays...

Any help much appreciated - can't find anything about this anywhere online!

A: 

Finally figured it out:

The example text creates the new dojox.grid.DataGrid and applies it to "document.createElement('div')" - changing this to the ID of an existing div fixed the problem (rather than appendChild-ing it to another div)

Original code:

var grid4 = new dojox.grid.DataGrid({ query: { Title: '*' }, store: store4, clientSort: true, rowSelector: '20px', structure: layout4 }, document.createElement('div'));

changes to:

var grid4 = new dojox.grid.DataGrid({ query: { Title: '*' }, store: store4, clientSort: true, rowSelector: '20px', structure: layout4 }, "gridContainer4");

Tom