Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#624 closed defect (fixed)

LayoutContainer doesn't work in programmaticaly in latest trunk

Reported by: anonymous Owned by: anonymous
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc: joose@…
Blocked By: Blocking:

Description

LayoutContainer? doesn't work in programmaticaly in latest trunk, here is test code:

<html>
<script type="text/javascript" src="trunk/dojo.js"></script>
<script type="text/javascript">
 dojo.require("dojo.widget.LayoutContainer");
 dojo.require("dojo.widget.ContentPane");

 dojo.addOnLoad(init);

 var login;

 function init() {
  var layout = dojo.widget.createWidget("LayoutContainer");
var taulu=["top","bottom","client","right","left"];
for(i=0; i<taulu.length; ++i) {
  var content = dojo.widget.createWidget("ContentPane", {layoutAlign: taulu[i]});
  content.setContent(taulu[i]);
  layout.addChild(content);
}
  dojo.html.body().appendChild(layout.domNode); 
 }
</script>
<body>
</body>
</html>

Also available in http://joose.iki.fi/dojo/layout-test.html

Change History (7)

comment:1 Changed 14 years ago by bill

Resolution: invalid
Status: newclosed

Hi Joose.

You need to specify a size for the layout container, and the left/right content panes should also have widths specified. In addition, you should first define init(), *and then* call dojo.addOnLoad(init).

comment:2 Changed 14 years ago by joose@…

Resolution: invalid
Status: closedreopened

Well, I changed the code, tested it with revision 3438, it works ok. But with latest revision, no luck. here is the code and link is also updated.

<script type="text/javascript">
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.ContentPane");

function init() {
        var layout = dojo.widget.createWidget("LayoutContainer");
        layout.domNode.style.width="300px";
        layout.domNode.style.height="300px";
        var taulu=["top","bottom","client","right","left"];
        for(i=0; i<taulu.length; ++i) {
                var content = dojo.widget.createWidget("ContentPane", {layoutAlign: taulu[i]});
                content.setContent(taulu[i]);
                layout.addChild(content);
        }
        dojo.html.body().appendChild(layout.domNode); 
}
dojo.addOnLoad(init);
</script>

I also tried to tell sizes to content, but it didn't make any difference.

comment:3 Changed 14 years ago by alex

Milestone: 0.3release
Version: 0.3

please target bugs to the milestone that they will be fixed in

comment:4 Changed 14 years ago by anonymous

Cc: joose@… added

comment:5 Changed 14 years ago by Dustin Machi

Milestone: 0.3release0.4

comment:6 Changed 14 years ago by bill

Milestone: 0.40.3release
Resolution: fixed
Status: reopenedclosed

This is working now, except for Safari. There's a separate bug filed for the safari problem.

comment:7 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.