Opened 10 years ago
Closed 10 years ago
#10172 closed defect (wontfix)
TabContainer inside templated+widgetsInTemplate widget inside Dialog doesn't layout correctly
Reported by: | vorun | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.4.0b |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
below is the example:
dojo.declare("dijit.TestWidget", [dijit._Widget, dijit._Templated], { templateString: dojo.cache("dijit", "tests/TemplateTest.html"), widgetsInTemplate : true });
<div dojoType="dijit.Dialog" id="tabDialog" title="TabContainer Dialog"> <div dojotype="dijit.TestWidget" style="width:400px; height:400px;"></div> </div>
TemplateTest?.html /
<div> <div dojoType="dijit.layout.TabContainer" style="width:400px; height:400px;"> <div dojoType="dijit.layout.ContentPane" title="tab 1"> </div> <div dojoType="dijit.layout.ContentPane" title="tab 2"> </div> </div> </div>
Attachments (4)
Change History (6)
Changed 10 years ago by
Attachment: | TemplateTest.html added |
---|
comment:1 Changed 10 years ago by
Description: | modified (diff) |
---|---|
Milestone: | tbd → 1.4 |
Owner: | set to bill |
Status: | new → assigned |
OK I'll take a look. For the future please attach testcases using the "attach file" button.
comment:2 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Summary: | TabContainer doesnt work in Dialog when using templateString → TabContainer inside templated+widgetsInTemplate widget inside Dialog doesn't layout correctly |
I don't think I can "fix" this but there's a workaround, or rather, a requirement about how you write your templated widget when that widget contains layout widgets. I'll attach modified code that works.
The problem is that TabContainer.resize() is called while the dialog is hidden (style="display: none"), and that won't work.
Need to change it so the Dialog, when shown, will call TestWidget.resize(), which will then call TabContainer.resize(). In your TestWidget:
isLayoutContainer: true,// signify that i'll call resize on my children resize: function(){ this.embeddedTabContainer.resize(); }
Of course you need that attach point in your template:
<div dojoType="dijit.layout.TabContainer" ... dojoAttachPoint="embeddedTabContainer">
template file