What about this bit here:
Ext.define('baseClass',{ a:null, ar:[], <--------------------------- you're instantiating an array object!
To make it clearer, the above code is equivalent:
Ext.define('baseClass',{ a:null, ar:new Array(),
Thus, both objects have the same array, because the constructor of the object only copies the reference to the array, not the full array object.
You donβt know how Ext.js handles constructors / initializers, but you need to create an array during the construction of the object, and not when you declare it ....
Ok, Googling gave me this:
Ext.define('baseClass',{ constructor: function () { this.ar = []; },
This should solve your problem.
source share