Skip to content

Instantly share code, notes, and snippets.

@dmachi
Created May 21, 2010 18:15
Show Gist options
  • Select an option

  • Save dmachi/409197 to your computer and use it in GitHub Desktop.

Select an option

Save dmachi/409197 to your computer and use it in GitHub Desktop.
jsonTemplate: [{dojoType: dijit.layout.ContentPane, params: {}, attachPoint: "foo"}],
postCreate: function(){
this.inherited(arguments);
dojo.forEach(this.jsonTemplate, this.instantiateChild, this);
}
instantiateChild: function(child){
var w=new child.dojoType(child.params);
this.addChild(w);
if (child.attachPoint){
this[child.attachPoint] = w;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment