Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The second and third snippet are functionally equivalent. <code>callParent</code> is just a cleaner and simpler way to invoke the parent's function instead of going through the <code>superclass</code> property. </p> <p>The first example is completely different. For one, it does not call the parent's constructor. This is usually bad news. The base class usually has some initialization that needs to get done, and forgetting to call the parent for constructor (and initComponent) is a common source of bugs. </p> <p><code>initConfig</code> is a convenience method which will: </p> <ul> <li>merge your object's initial config with the config that is passed in</li> <li>create getters and setters for all properties in the config</li> <li>apply the config to the object</li> </ul> <p>This is entirely different from invoking the parent constructor. What invoking the parent constructor does is entirely dependent on what it's written to do. Some will use <code>initConfig</code>, some won't, and others will do similar things that initConfig does, but manually.</p> <p>It's not necessary to use <code>initConfig</code>, and it's even dangerous at times. But that's another story altogether (for Ext 4.1, initConfig looks to be hopefully harmless and not contain the same dangerous side effects that it has in 4.0) </p> <h2>Side Note</h2> <p>Just to point out. In the second and third snippet, the constructor is not needed. If your constructor is only calling the parent's constructor, then you can leave your constructor out altogether.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload