[Dojo-interest] Question about dojo.mixin and this.inherited()

Kenneth G. Franqueiro kgf at dojotoolkit.org
Mon Aug 1 21:14:31 EDT 2011


Actually, to be clear, this.inherited does need to be passed THE
arguments object, as declare uses that to figure out what was called to
be inherited.  If you want to pass a different set of arguments to the
inheriting function, specify it as another argument subsequent to
arguments itself.

See the following sections of the reference guide page for declare:

http://dojotoolkit.org/reference-guide/dojo/declare.html#calling-superclass-methods

http://dojotoolkit.org/reference-guide/dojo/declare.html#inherited

--Ken

On 8/1/2011 1:49 PM, ben hockey wrote:
> bill,
> 
> the call to this.inherited was fine - you can specify the "inherited"
> function to call and then pass in a pseudo-arguments object.
> 
> the real problem was what you suspected... dijit.findWidgets gets _child
> from the dijit registry rather than child.
> 
> ben...
> 
> On 8/1/2011 1:29 PM, Bill Keese wrote:
>> You are creating a new object for the child widget:
>>
>> var child = dojo.mixin({}, _child);
>>
>> My guess is that at some point the new object disappears... after the
>> child.domNode gets added as a child of BorderContainer.containerNode,
>> then at some point there's a dijit.byId(...) call which returns the
>> original child (rather than your new object), since the original child
>> object is in the dijit registry.
>>
>> Also, doesn't the first argument to this.inherited() need to be
>> "arguments"?
>>
>>
>> On Tue, Aug 2, 2011 at 1:40 AM, Alexander Kläser
>> <klaeser at univention.de <mailto:klaeser at univention.de>> wrote:
>>
>>     Dear all,
>>
>>     Can anyone explain the following behaviour?
>>
>>     In my own child class of dijit.layout.BorderContainer, I altered the
>>     addChild() method to add "region='center'" to the element being
>>     added in case
>>     it is not set already. However, in dijit.layout._LayoutWidget.js
>>     (line 261),
>>     the position (i.e. region) is still undefined, although it was set
>>     in my
>>     custom addChild() method (I verified it with the chromium debugger and
>>     breakpoints). Here is sample code:
>>
>>     http://jsfiddle.net/nhxzE/7/
>>
>>     Does this make sense? Am I missing something? I tried to use
>>     dojo.delegate(),
>>     but this would not change anything.
>>
>>     Thanks a lot for any hints!
>>
>>     best
>>     Alexander Kläser
>>
>>     --
>>     Dr. Alexander Kläser
>>     Open Source Software Engineer
>>
>>     Univention GmbH
>>     Linux for your business
>>     Mary-Somerville-Str.1
>>     28359 Bremen
>>     Tel. : +49 421 22232-59 <tel:%2B49%20421%2022232-59>
>>     Fax : +49 421 22232-99 <tel:%2B49%20421%2022232-99>
>>
>>     klaeser at univention.de <mailto:klaeser at univention.de>
>>     http://www.univention.de
>>
>>     Geschäftsführer: Peter H. Ganten
>>     HRB 20755 Amtsgericht Bremen
>>     Steuer-Nr.: 71-597-02876
>>
>>     ________________________________________________________
>>     Dojotoolkit: http://dojotoolkit.org
>>     Reference Guide: http://dojotoolkit.org/reference-guide
>>     API Documentation: http://dojotoolkit.org/api
>>     Tutorials: http://dojotoolkit.org/documentation
>>
>>     Dojo-interest at mail.dojotoolkit.org
>>     <mailto:Dojo-interest at mail.dojotoolkit.org>
>>     http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>>
>>
>>
>> ________________________________________________________
>> Dojotoolkit: http://dojotoolkit.org
>> Reference Guide: http://dojotoolkit.org/reference-guide
>> API Documentation: http://dojotoolkit.org/api
>> Tutorials: http://dojotoolkit.org/documentation
>>
>> Dojo-interest at mail.dojotoolkit.org
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
> 
> 
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
> 
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


More information about the Dojo-interest mailing list