Opened 8 years ago

Closed 8 years ago

#15468 closed defect (invalid)

I programmatically create a ContentPane, then add a TabContainer to the pane, it not render rightly

Reported by: jzw Owned by: bill
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Always, we create a ContentPane?, then add a TabContainer? to the pane, finally call startup(), it works.

But sometimes, we need call ContentPane?.startup(), then add the TabContainer? to the ContentPane? when user do sth. but not render rightly.

Am I missing somthing?

Attachments (1)

addTabToPane.html (1.1 KB) - added by jzw 8 years ago.

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by jzw

Attachment: addTabToPane.html added

comment:1 Changed 8 years ago by bill

Owner: set to jzw
Status: newpending

Yes, you are missing something, but without a test case I can't tell what you are doing wrong.

comment:2 Changed 8 years ago by bill

Status: pendingopen

Ah, I see the test case now, I'll take a look.

comment:3 Changed 8 years ago by bill

Owner: changed from jzw to bill
Status: openassigned

comment:4 Changed 8 years ago by jzw

I tested use the latested dojo code. Browser is Chrome 19.0.1084.52.

comment:5 Changed 8 years ago by bill

OK, so do you want the TabContainer to be sized to take up the full width and height of the ContentPane.

IIRC although ContentPane has special code for when there's only one child, it doesn't kick in during addChild(), which means that you should try calling ContentPane.resize() after the addChild().

comment:6 Changed 8 years ago by jzw

Thanks very much!

It's ok when TabContainer? doesn't set style property or set style to "width:100%;height:100%", but other case should not sized to take up the full width and height of the ContentPane?,because maybe add other widget after the TabContainer?.

After call ContentPane?.resize(), it's works now. Maybe it's better to call the ContentPane?.resize() unkown for programmer.

If the ContentPane? has one Toolbar, one TabContainer?, how to set the TabContainer? take up the rest of width and height of the ContentPane?.

comment:7 Changed 8 years ago by bill

After call ContentPane.resize(), it's works now. Maybe it's better to call the ContentPane??.resize() unkown for programmer.

Well, if addChild() called resize() automatically then resize() would be called n times (when n children are added).

If the ContentPane has one Toolbar, one TabContainer, how to set the TabContainer take up the rest of width and height of the ContentPane?

It sounds like you want to use BorderContainer not ContentPane.

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

comment:8 Changed 8 years ago by jzw

:) Thanks!

comment:9 Changed 8 years ago by bill

Resolution: invalid
Status: assignedclosed

Closing as "working as expected", you need to call resize() after the addChild()'s.

Note: See TracTickets for help on using tickets.