Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#2586 closed defect (wontfix)

LayoutContainer: bottom-aligned ContentPane may be incorrectly aligned after content is changed

Reported by: guest Owned by: koranteng
Priority: high Milestone: 1.3
Component: Dijit Version: 0.4.1
Keywords: ContentPane, layout, LayoutContainer Cc:
Blocked By: Blocking:


If a bottom-aligned ContentPane? is given new content that has a different height than the prior content, the pane will stay at the old location until a resize occurs. I have tested with FF 1.5 and IE 6, and have used dojo-ajax-0.4.1 as well as the 2007-02-12 nightly build.

I can work around this problem by having the containing LayoutContainer? refresh its layout after the content is changed, but this is inconvenient and seems like something the framework should provide.

Sample code to observe the problem (click the test button and observe that the new, shorter content is not bottom-aligned):

    <script type="text/javascript">
        var djConfig = { isDebug: true };
    <script type="text/javascript" src="js/dojo/dojo.js"></script>

    <script type="text/javascript">

        function swap()
            dojo.widget.byId('bottom').setContent('This should be at the bottom');

            dojo.event.connect(dojo.byId("button"), "onclick", "swap");

<button id="button" name="test">test</button>
<div id="parent"
     style="width: 100%; height: 80%; overflow: hidden; border : solid 1px #aaa;"
    <div id="top" dojo:type="ContentPane" dojo:layoutAlign="client">
        This is the top.
    <div id="bottom" dojo:type="ContentPane" dojo:layoutAlign="bottom">
        This is the bottom.<br>foo<br>bar


One possible solution: in ContentPane?.onLoad, something like the following:

var parent = this.parent;
while (parent && !(parent instanceof dojo.widget.LayoutContainer))
    parent = parent.parent;
if (parent)
    dojo.widget.html.layout(parent.domNode, parent.children, parent.layoutChildPriority);

Change History (4)

comment:1 Changed 15 years ago by bill

Component: WidgetsDijit
Owner: changed from bill to koranteng

Hmm, not sure if we ever want to support something like this, given that you can just call layout() on the parent layout container again. Let's think about it.

comment:2 Changed 15 years ago by bill

Milestone: 2.0
Summary: bottom-aligned ContentPane may be incorrectly aligned after content is changedLayoutContainer: bottom-aligned ContentPane may be incorrectly aligned after content is changed

comment:3 Changed 14 years ago by bill

Resolution: wontfix
Status: newclosed

OK, for bottom/top components in layout you need to specify a height. That's a requirement.

comment:4 Changed 14 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.