Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem here is that you are trying to inherit an object (pass by reference), which works completely different than pass by value types like numbers and strings in Extjs. If you change your example to:</p> <pre><code>&lt;script type='text/javascript'&gt; //Defining the Parent below Ext.define('Ext.mine.TextParent', { extend: 'Ext.form.field.Text', alias: 'widget.textParent', testConfig:"cheese" }); //Defining the Child A below Ext.define('Ext.mine.child.TextChildA', { extend: 'Ext.mine.TextParent', alias: 'widget.textChildA', constructor:function(){ var me = this; me.testConfig = 'Child A Value';//Adding the key value to Child A me.callParent(); } }); //Defining the Child B below Ext.define('Ext.mine.child.TextChildB', { extend: 'Ext.mine.TextParent', alias: 'widget.textChildB' }); &lt;/script&gt; </code></pre> <p>it will work correctly because testConfig is now a pass by value type of string. The reason behind this is because Extjs is not designed to make new instances of objects in sub-classes because deep copies of objects in javascript is very complex and not even possible for many objects. This is because some deep copies may not even make logical sense (think of copying an object that has a circular reference, how does the copy function know when to stop?). Since some deep copies don't make logical sense to do on objects, there can be no generalized solution to doing deep copies, therefore if you create an object at the highest level in your inheritance tree, this object will actually be the same instance of that object for every subclass.</p> <p>If you notice the extjs core code, almost 100% of the time, all config options are pass by value types, and this is the model you are supposed to follow. In the example you provided, there is no logical necessity for creating an object of config options when you could just put all those config options at the class level and it will logically mean the same thing.</p> <p>I guess if you really want to simplify what I'm trying to say here, it boils down to pass by reference versus pass by value. You can only use pass by value for config options if you want the inheritance to work like it should.</p>
    singulars
    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