Opened 12 years ago
Closed 12 years ago
#9477 closed defect (fixed)
Can't load layout widget within customer widget template
Reported by: | renee zhu | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.3.1 |
Keywords: | layout widget | Cc: | Nathan Toone, dante |
Blocked By: | Blocking: |
Description
hello, dojo team
With dojo version before 1.3, I can use layout widget inside customer widget template with widgetsInTemplate : true
Now it can not be done in this way. so what is the standard solution for this kind of case that customer widget need complicate nested layout ? and why dojo didn't support it anymore ?
Attachments (3)
Change History (9)
Changed 12 years ago by
Attachment: | index.html added |
---|
Changed 12 years ago by
Attachment: | Desktop.html added |
---|
comment:1 Changed 12 years ago by
Replying to renee zhu:
hello, dojo team
With dojo version before 1.3, I can use layout widget inside customer widget template with widgetsInTemplate : true
Now it can not be done in this way. so what is the standard solution for this kind of case that customer widget need complicate nested layout ? and why dojo didn't support it anymore ?
comment:3 Changed 12 years ago by
Cc: | Nathan Toone dante added |
---|---|
Milestone: | tbd → 1.4 |
This was theoretically fixed in #9348 although I'm still seeing some issues. One problem is that the BorderContainer in your template isn't getting added to _supportingWidgets b/c it's the top level node in the template (this is a bug). That can be worked around by adding a wrapper <div> to your template.
However, the other problem is that although BorderContainer.startup() is being called, since BorderContainer thinks it's a child of Desktop, since Desktop is marked as a Container, it assumes that Desktop will call BorderContainer.resize() and thus doesn't try to resize itself.
In your case (or at least in your test case) you can simple remove the _Container inheritance in Desktop, and add in that extra wrapper <div> into the template, and then it works, but I'd like to resolve these issues properly.
comment:4 Changed 12 years ago by
Still working on this. I've decided though that we can't support having a widget as the root node of a template, like your Desktop.html template:
<div dojoType="dijit.layout.BorderContainer" design="sidebar" gutters="true" liveSplitters="true" id="borderContainer"> ... </div>
The problem is that in the generated DOM, the Desktop widget's id and the BorderContainer widget's id will try to be applied to the same node:
<div id="Desktop_0" widgetId="Desktop_0" id="borderContainer" widgetId="borderContainer"> ...
Thus, you will need to have a wrapper div in your Desktop template:
<div> <div dojoType="dijit.layout.BorderContainer" design="sidebar" gutters="true" liveSplitters="true" id="borderContainer"> ... </div> </div>
comment:5 Changed 12 years ago by
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
index.html