#11430 closed defect (fixed)
BorderContainer: removing/adding pane does not remove old style information
Reported by: | Simon Speich | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.6 |
Component: | Dijit | Version: | 1.5.0rc1 |
Keywords: | Cc: | ben hockey | |
Blocked By: | Blocking: |
Description
Lets say I have a ContentPane? with region property set to 'center'. Now I want to change my layout and I set the region of that pane to 'bottom'. This does not work properly, since changing the region does not remove the old style information (e.g. 'top: 0'). The style attribute ends with containing both: 'bottom: 0; top: 0'. Workaround is to explicitly remove the top or set the top to auto.
var pane = new dijit.layout.ContentPane({ region: 'center' }); pane.set('region', 'bottom'); // pane.style will contain top: 0; bottom: 0;, but should only be bottom: 0 // workaround dojo.style(pane, 'top', 'auto');
I think setting the region should remove the corresponding style information first (e.g. top, left, bottom, right) before setting it to prevent conflicting style information.
Change History (8)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
That is actually what I'm doing. But instead of completely destroying the widget and having to recreate the pane completely, I only reset the region. This works except for that I have to reset the style attribute:
var bc = new dijit.layout.BorderContainer({}); var pane = new dijit.layout.ContentPane({ region: 'center' }); bc.addChild(pane); ... bc.removeChild(pane); pane.set('region', 'bottom'); // this is necessary otherwise top would be 0 from region = center dojo.style(pane, 'top', 'auto');center bc.addChild(pane);
comment:3 Changed 11 years ago by
Summary: | Changing region in ContentPane does not remove old style information → BorderContainer: removing/adding pane does not remove old style information |
---|
Also, changing the "left" pane to be the "top" pane won't work because the width setting is left over on the "left" pane.
comment:4 Changed 11 years ago by
comment:5 Changed 11 years ago by
Cc: | ben hockey added |
---|
comment:6 Changed 10 years ago by
Milestone: | tbd → 1.6 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Some of this will become moot when #11030 is checked in, because that will eliminate the top/bottom/left/right setting and just set top/left/width/height. Regardless, I'll add code now to remove the attributes that BorderContainer set.
comment:7 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
you presently can't change the region property. You need to remove and re-add the pane.