#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: |
Description
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.
Attachments (1)
Change History (8)
Changed 13 years ago by
Attachment: | test_gridParent.html added |
---|
comment:2 Changed 13 years ago by
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 13 years ago by
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}); dojo.byId('grid').appendChild(grid.domNode); grid.render(); grid.startup();
This doesn't work (for me):
var grid = new dojox.Grid({id:"pGrid",model:model,structure:layout},"grid"); grid.render(); grid.startup();
comment:4 Changed 13 years ago by
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 13 years ago by
Milestone: | 1.0.2 → 1.0.3 |
---|
comment:6 Changed 13 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Original Poster: Closing, works for me, now.
Programmatic Grid as non-child descendant of body fails to display data