0

Why using this.parent()

Hi!

I really want too understand why i need to use this.parent() in my initialize methods.
What the real function of this method?

CODE
	initialize: function() {
this.parent();
},


Regards,
Rafael bueno

by
2 Replies
  • QUOTE (Rafael @ May 26 2010, 05:27 AM) <{POST_SNAPBACK}>
    Hi!

    I really want too understand why i need to use this.parent() in my initialize methods.
    What the real function of this method?

    CODE
    	initialize: function() {
    this.parent();
    },


    Regards,
    Rafael bueno

    Hi Rafael,
    this.parent() allows you access to the parent class' initialize method.

    In fact, no methods are overwritten. Instead, calling this.parent() inside any method allows you access to its parent class' same-named method.

    Use initView() instead. You don't need to call this.parent() inside of it.

    - Ben
    0
  • Try to check the code of component which you inherit and look does init method doing something or not.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets