PDA

View Full Version : Problem getting the this.up() method working.



mjeulinl
17 Nov 2014, 7:30 AM
Hi folks,

It's my very fisrst post here, please be tolerant.
I currently get error working with the up() method that returns "undefined" on my component.

Here is my code:



constructor: function () {
this.callParent(arguments);
this._fillToolbarContext();
},

_fillToolbarContext : function () {
var me = this;
console.log(me.up());
}

The log returns "undefined" whereas logging "me" return an 'OwnerCt' with:


xtype: "interactionContainerCardMain"


I'm puzzled about my comprehension of the documentation and why this is not working.

Walks up the ownerCt axis looking for an ancestor Container which matches the passed simple selector.

Thank you,
Best Regards.

mjeulinl
17 Nov 2014, 8:10 AM
Sorry, it was only a matter of sequencing.
I have overidded instead the "onAdded" methods:


It's set after the add has completed. You are referencing ownerCt before the Component is owned.


However, I still don't know how to wait until all its parent hierarchy has been added as to do me.up().up()