Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#5204 closed defect (worksforme)

Grid--Programmatic creation as non-child descendant of Body fails to display its data

Reported by: guest Owned by: sorvell
Priority: high Milestone:
Component: DojoX Grid Version: 1.0
Keywords: grid programmatic Cc: [email protected]
Blocked By: Blocking:


If you programmatically create a Grid and use srcNodeRef or htmlNode.appendChild(grid.domNode) to have the Grid be a child of Body, the Grid data displays. If the Grid is defined to be a non-child descendant of Body, the data does not display.

However, widget.addChild(grid) works, as does "non-child of Body" markup. The markup parser handles it fine.

The data is loaded, as shown by Firebug.

This may be a parentNode problem. See Refs below.

This can be demonstrated in the attached test_gridParent.html, which is test_Grid.html with the above parentNode test cases. Just move the div with id of "grid" to be a child of body, and the grid data will display.

Ref: 11434 5048 4892

Attachments (1)

test_gridParent.html (3.0 KB) - added by guest 14 years ago.
Programmatic Grid as non-child descendant of body fails to display data

Download all attachments as: .zip

Change History (8)

Changed 14 years ago by guest

Attachment: test_gridParent.html added

Programmatic Grid as non-child descendant of body fails to display data

comment:1 Changed 14 years ago by Adam Peller


could this be a dup of #5048?

comment:2 Changed 14 years ago by guest

Original poster: It could be, although it could also be that the fix corrected the 5048 problem, but didn't go far enough to address this problem.

This ticket (5204) is not IE related (tested in FF2), as 5048 indicates, although it *could* be a "resize" issue that 5048 attempted to resolve.

An odd thing is that I saw another very similar example (not using the testing debug .js statements that test files use), where, with the TundraGrid?.css enabled, the data would not display, but removing the TundraGrid?.css, the data did display, but in a very messy manner, but in the correct location within the Grid. For this ticket, I just wanted to take a simple file from "tests". Didn't look into the "test" css file, although that might be worth doing.

See forum post

comment:3 Changed 14 years ago by guest

Original Poster Update: Don't know what, if anything, changed, but a narrowing of what works, doesn't in the above example:

This works:

var grid = new dojox.Grid({id:"pGrid",model:model,structure:layout});

This doesn't work (for me):

var grid = new dojox.Grid({id:"pGrid",model:model,structure:layout},"grid");

comment:4 Changed 14 years ago by guest

Original Poster: Please 'invalid' this ticket. If I start with the tests version of test_grid_programmatic.html, I can make all cases work. There is some variation (data vs. no data displayed), based on child of Body, *if* no style height/width is defined for the grid. Also, besides grid.startup(), in some of the ten or so tests I ran, grid.render() being present made a difference. Thanks.

comment:5 Changed 14 years ago by Adam Peller


comment:6 Changed 14 years ago by Frank Fortson

Resolution: worksforme
Status: newclosed

Original Poster: Closing, works for me, now.

comment:7 Changed 14 years ago by (none)

Milestone: 1.0.3

Milestone 1.0.3 deleted

Note: See TracTickets for help on using tickets.