Last active
December 11, 2015 21:48
-
-
Save olizilla/4665211 to your computer and use it in GitHub Desktop.
A proposal for an ExtJS 3 component initialisation pattern.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.namespace('foo'); | |
foo.UpdatePositionDialog = Ext.extend(Ext.Window, { | |
/** | |
* @param {Object} config Instance configuration options | |
*/ | |
constructor:function (config) { | |
// Merge the incoming config with the defaults. Externally provided properties take precedence. | |
config = Ext.apply({ | |
cls:'UpdatePositionDialog', | |
width:600, | |
height:'auto' | |
}, | |
config || {}); // Alas Ext is still a bit rubbish so we have to guard against a null config | |
foo.UpdatePositionDialog.superclass.constructor.call(this, config); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment