Login Register

ContentPane- load modules option

I was wondering why there's no option for the ContentPane to load modules referenced in the content.
I think this would be a rather simple addition, see below:

_createSubWidgets: function(){
	// summary: scan my contents and create subwidgets
	if(this.loadModules) {
		dojo.query('[dojoType]', this.domNode).forEach(function(node) {
			var resource = dojo.attr(node, 'dojoType');
			dojo.require(resource);
		 });
	}
	try{
		dojo.parser.parse(this.containerNode, true);
	}catch(e){
		this._onError('Content', e, "Couldn't create widgets in "+this.id
			+(this.href ? " from "+this.href : ""));
	}
},

There is .. over in dojox.layout.ContentPane

The old 0.4x version had a ContentPane with a bunch of options. I think when they did Dijit, they made the dijit widgets midgets .. heh heh, in other words, they made dijit have a simplified option set. There is, however, a better ContentPane, that does what you want, over in dojox.layout.ContentPane . I think they recommend against doing require's in the loaded content, but it has worked for me. executeScripts or something like that ... look around in it, I can't remember if that's the option or not.

Dylan Tynan

I'm using the dojox.layout.ContentPane

... but it requires me to list the dojo.require statements. The addition that I'm asking for builds the lists in code. This would be a lot simpler.

I created a ticket for this enhancement