Login Register

_Widget.placeAt method

I noticed this cool new method added to the _Widget class... (the internal doc is very helpful BTW)

I have a small suggestion. The code could be simplified, see below:

placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
   if(reference["declaredClass"] && reference["addChild"]){ 
      reference.addChild(this, position); 
   }else{ 
      dojo.place(this.domNode, reference, position); 
   } 
   return this;
}

hey good catch. I just

hey good catch. I just looked at place and it looks like the reference is passed through dojo.byId in there, so you are absolutely right ... thanks.

ps: this feature will be available in Dojo 1.2, and was added just this morning. (for those of you not following trunk as closely as Les, or otherwise stumbling upon this thread)