Opened 12 years ago

Closed 11 years ago

#3450 closed defect (fixed)

StackContainer/TabContainer: support non-fixed sized

Reported by: bill Owned by: bill
Priority: high Milestone: 1.2
Component: Dijit Version: 0.9
Keywords: Cc: alex
Blocked By: Blocking:

Description (last modified by bill)

The doLayout flag from 0.4 days is broken, and needs to be fixed...

StackContainer? has a doLayout flag that you use to make the height of each pane equal. Example #1:

<div dojoType="dijit.layout.StackContainer" style="height: 300px;"
                doLayout=true>
   <div dojoType=...> short content </div>
   <div dojoType=...> long content </div>
</div>

When the above widget is displayed, regardless of which child is being shown, it will be 300px tall. There will be a scrollbar if necessary, or added whitepace to extend the short content to 300px.

Example #2:

<div dojoType="dijit.layout.StackContainer" doLayout=false>
   <div dojoType=...> short content </div>
   <div dojoType=...> long content </div>
</div>

When the above widget is displayed, it will change height depending on which child is being shown. All it basically does is show one div and hide the others.

As a bonus, maybe we could detect if the user wanted layout automatically, rather than needing a doLayout flag. Seems like we could detect if the user wanted us to adjust heights by whether or not height was set explicitly on the StackContainer? widget. The problem is that the height may be set explicitly, but indirectly, via CSS:

<style>
  #foo { height: 300px; }
</style>
<div dojoType="dijit.layout.StackContainer" id=foo >
   <div dojoType=...> short content </div>
   <div dojoType=...> long content </div>
</div>

Change History (14)

comment:1 Changed 12 years ago by Adam Peller

Summary: PageContainer: remove doLayout flagStackContainer: remove doLayout flag

comment:2 Changed 12 years ago by Adam Peller

see #4019

comment:3 Changed 12 years ago by bill

Description: modified (diff)

comment:4 Changed 12 years ago by bill

Description: modified (diff)

comment:5 Changed 12 years ago by Adam Peller

Milestone: 1.01.1
Priority: normalhigh

comment:6 Changed 12 years ago by bill

Description: modified (diff)
Summary: StackContainer: remove doLayout flagStackContainer/TabContainer: support non-fixed sized

comment:7 Changed 11 years ago by bill

This should be fairly trivial (just don't call resize()) on the child, but the one trick is that the parent object should/shouldn't have the (confusingly named) isContainer flag if it is/isn't doing layout. See ContentPane for comparison.

comment:8 Changed 11 years ago by alex

Cc: alex added

comment:9 Changed 11 years ago by bill

Priority: highnormal

comment:10 Changed 11 years ago by bill

Owner: changed from Adam Peller to bill

I'll work on this for 1.1 if I have some free time for it; otherwise will defer to 1.2.

comment:11 Changed 11 years ago by alex

I know we don't have bugzilla style voting for bugs, so consider this my "+1" for getting this into 1.1

comment:12 Changed 11 years ago by bill

(In [13092]) Get basic TabContainer? doLayout=false working. Refs #3450. More complex cases probably aren't working yet and the CSS needs some tweaks too.

comment:13 Changed 11 years ago by bill

Milestone: 1.11.2

Move all milestone 1.1 tickets to 1.2, except for reopened tickets and tickets opened after 1.1RC1 was released.

This is sort of working already but not completely so leaving open for 1.2.

comment:14 Changed 11 years ago by bill

Description: modified (diff)
Resolution: fixed
Status: newclosed

OK, this is working now (for tabs w/the tab labels on top, only).

Note: See TracTickets for help on using tickets.