Opened 9 years ago

Last modified 2 years ago

#12599 assigned defect

dijit.Editor in dojox.layout.TableContainer resize/layout bug

Reported by: patrickzope Owned by: dylan
Priority: high Milestone: 1.14
Component: DojoX Layout Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

When a dijit.Editor is placed in a dojox.layout.TableContainer, an exception is raised, because the editor's layout method expects a "_contentBox" attribute to be set on the instance, but in this case it is not (see attached test case).

The Editor seems to assume that the layout widget will call its resize method and pass in an argument; the TableContainer calls resize without passing in any arguments.

We've worked around this in our code with the following:

editor.resize = function () {
    dijit.layout._LayoutWidget.prototype.resize.apply(
        editor, arguments);
};

Attachments (1)

dijiteditorbug.html (844 bytes) - added by patrickzope 9 years ago.
test case that demonstrates the bug

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by patrickzope

Attachment: dijiteditorbug.html added

test case that demonstrates the bug

comment:1 Changed 9 years ago by bill

Component: DijitDojoX Layout
Description: modified (diff)
Owner: set to Shane O'Sullivan
Summary: dijit.Editor resize/layout bugdijit.Editor in dojox.layout.TableContainer resize/layout bug

Well I think the issue is that TableContainer is calling layout() on it's children, rather than calling resize(). Here's the code in TableContainer:

// Refresh the layout of any child widgets, allowing them to resize
// to their new parent.
dojo.forEach(children, function(child){
	if(typeof child.layout == "function") {
		child.layout();
	}
});

comment:2 Changed 8 years ago by PEM

A simple fix would be to just make use of the _LayoutWidget property : isLayoutContainer

// Refresh the layout of any child widgets, allowing them to resize
// to their new parent.
dojo.forEach(children, function(child){
	if(typeof child.layout == "function" && this.isLayoutContainer) {
		child.layout();
	}
});

can someone please fix this ? Note that this is *not* a bugfix, but it allows you to specify if the TableContainer? should layout or not it's children. You can set to false when you have an editor for example.

I believe the real bug comes from the Editor which does not really comply to what layout widget should.

Anyway, it would be nice to add the check on isLayoutContainer, or add a doLayout.

Last edited 8 years ago by PEM (previous) (diff)

comment:3 Changed 4 years ago by dylan

Milestone: tbd1.11
Owner: changed from Shane O'Sullivan to dylan
Status: newassigned

I will apply PEM's suggested change in TableContainer? for 1.11.

comment:4 Changed 4 years ago by dylan

Milestone: 1.111.12

Ok, after massive triage, ended up with about 80 tickets for 1.11 and 400 or so for 1.12. That's a bit unrealistic, so first I changed all 1.12 to 1.13 (with the plan to move some forward to the new 1.12. Now, I'm moving some of the 1.11 tickets that are less likely to get done this month without help to 1.11. Feel free to help out in January if you want to see this ticket land in 1.11.

comment:5 Changed 3 years ago by dylan

Milestone: 1.121.13

Ticket planning... move current 1.12 tickets out to 1.13 that likely won't get fixed in 1.12.

comment:6 Changed 2 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.