I'm trying to setup a base class and derived class with ExtJS using Ext.extend.
:Base Class:
var Base = Ext.extend(Object, {
settings: {},
constructor: function(args) {
var baseArgs = { 'user': '', 'password': '' };
Ext.apply(this.settings, args, baseArgs);
}
});
:Derived Class:
var Derived = Ext.extend(Base, {
constructor: function(args) {
Derived.superclass.constructor.call(this, args);
}
});
:Problem:
var test1 = new Derived({ 'user': 'blackey1', 'password': 'blackeypw1' });
var test2 = new Derived({ 'user': 'blackey2', 'password': 'blackeypw2' });
At this point test1.settings is equivalent to test2.settings (using blackey2 and blackeypw2) as if they are pointing to the same object, I'm looking to find how to create independent objects.
Thanks for any help!