Login Register

addChild

When is the best time to call addChild on layout containers?

I can't find this answer in the Book of Dojo. I'm nesting layout containers inside layout containers. When should I call addChild() to add it to the parent container?

Should I add them as I create them?....

var bc1 = new dijit.layout.BorderContainer(...);
var bc2 = new dijit.layout.BorderContainer(...);
bc1.addChild(bc2);
var bc3 = new dijit.layout.BorderContainer(...);
bc2.addChild(bc3);

...or should I create all of them first, and then add them together at the end?

var bc1 = new dijit.layout.BorderContainer(...);

Syndicate content