Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#5169 closed enhancement (patchwelcome)

dojox.layout.ContentPane with LayoutContainer abilities — at Version 1

Reported by: guest Owned by: Tom Trenka
Priority: high Milestone: 1.13
Component: DojoX Layout Version: 1.0
Keywords: layouting contentpan Cc:
Blocked By: Blocking:

Description (last modified by bill)

I'm in need for a ContentPane? that loads its content remotely and acts as a LayoutContainer? for all its loaded widgets. I didn't find a solution with the standard widget set, so I created one on my own. Perhaps there's a chance to get this abilities into dojox.layout.ContentPane? directly. Here is my snippet of code for the widget.

dojo.provide("tas.LayoutContentPane")

dojo.require("dijit.layout.LayoutContainer");
dojo.require("dojox.layout.ContentPane");

dojo.declare("tas.LayoutContentPane", 
							[dojox.layout.ContentPane,dijit.layout.LayoutContainer],
{
postCreate : function() {
dojox.layout.ContentPane.prototype.postCreate.apply(this, arguments);
dijit.layout.LayoutContainer.prototype.postCreate.apply(this, arguments);
}
,startup	: function(){
dojox.layout.ContentPane.prototype.startup.apply(this, arguments);
dojo.connect(this,"onLoad",this,"startupChildren")
}

,layout : function() {
tas.LayoutContentPane.superclass.layout.call(this,arguments)
}
,startupChildren : function() {
if(this.getChildren){
dojo.forEach(this.getChildren(), function(child){ child.startup(); });
}
this.layout()
}
}
)

I'm not sure whether or not that code is optimized for dojo. It simply works for me. Perhaps one could have a look onto it. I will repost this at the dojox developer forum for better code highlighting.

Change History (1)

comment:1 Changed 14 years ago by bill

Description: modified (diff)
Milestone: 1.0
Resolution: fixed
Status: newclosed

Hi, as a last minute change in 1.0 I added the ability for ContentPane? to load from an href and have a single layout widget (LayoutContainer?) as it's child, see #4826. I think that satisfies your needs? I guess your code is slightly more convenient because it's one widget instead of two (a ContentPane? which loads a LayoutContainer?), but basically the same, right?

Note: See TracTickets for help on using tickets.