Opened 11 years ago

Last modified 5 years ago

#12982 assigned defect

GridContainer offsets column index when manually organized

Reported by: stefan_t Owned by: dylan
Priority: high Milestone: 1.15
Component: DojoX Layout Version: 1.6.1
Keywords: gridcontainer isAutoOrganized Cc:
Blocked By: Blocking:


When creating a manually organized dojox.layout.GridContainer? (isAutoOrganized: false) programmatically to place widgets in specific columns the error "Unable to insert child in GridContainer?" appears in the console for widgets placed in column 0.

It appears the addChild method assumes a zero-based column index, but the _organizeChildrenManually method assumes a one-based column and thus subtracts 1 from the column before calling _insertChild to re-arrange child widgets.

Another effect is that it's impossible to place widgets in the last column.

Example to reproduce:

dojo.addOnLoad(function() {

var cpane1 = new dijit.layout.ContentPane?({ title:"cpane1", content: "Content Pane 1 : Drag Me !" }),

cpane2 = new dijit.layout.ContentPane?({ title:"cpane2", content: "Content Pane 2 : Drag Me !" }), cpane3 = new dijit.layout.ContentPane?({ title:"cpane3", content: "Content Pane 3 : Drag Me !" });

var gridContainer = new dojox.layout.GridContainer?({

nbZones: 3, isAutoOrganized: false

}, dojo.byId("rootNode"));

gridContainer.addChild(cpane1, 0, 0); gridContainer.addChild(cpane2, 1, 0); gridContainer.addChild(cpane3, 2, 0); gridContainer.startup();


Attachments (1)

GridContainerLite.js.patch (730 bytes) - added by stefan_t 11 years ago.
Patch for GridContainerLite?

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by stefan_t

Attachment: GridContainerLite.js.patch added

Patch for GridContainerLite?

comment:1 Changed 9 years ago by dwinkler

This bug still exists in Dojo version 1.8.0; You can circumvent it by first starting up the GridContainer?.

comment:2 Changed 9 years ago by postkassa

Patched local copy of GridContainerLite?.js line 454 to be:

child.set("column", column + 1);

and on dropping in the last column the gridcontainer redrew itself correctly. Might break something else though.

comment:3 Changed 6 years ago by dylan

Milestone: tbd1.12
Owner: set to dylan
Status: newassigned

comment:4 Changed 5 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.