extjs objects
http://stackoverflow.com/questions/15479598/extjs-merge-objects/15480004
HTML
<link rel="stylesheet" href="http://cdn.sencha.io/ext-4.1.1-gpl/resources/css/ext-all.css">
<script src="http://cdn.sencha.io/ext-4.1.1-gpl/ext-all.js"></script>
Inspect Console for the output.
JavaScript
Ext.define('superclass', {
myObject: {
prop1: true,
prop2: 200,
}
});
Ext.define('childclass', {
extend: 'superclass',
constructor: function() {
this.myObject = Ext.merge({}, this.myObject, {
prop1: false,
prop4: false
});
this.callParent(arguments);
}
});
var child = Ext.create('childclass');
var _super = Ext.create('superclass');
console.log('super: ', _super.myObject);
console.log('child: ', child.myObject);