If a function is defined inside the config object that is passed to Ext.application(), is there a way to override this function definition. Also, another point to note is that application is created inside Ext.onReady(function(){...
Here is an example
Ext.onReady(function() {
Ext.application({
name: 'TestApplication',
customFunction: function(obj) {
//Some function definition.. .. ..
}
});
launch: function() { window.appl = this; }
...
});
This code is from a js file that I can't change and I need to override the definition of customFunction from another js file that loads later in the sequence.
The only way I'm able to achieve this is using Ext.onReady in my file as well.
Ext.onReady(function() {
appl.customFunction = function (obj) {
//My own definition
}
});
Now my question is, is this a proper way to do this? Or is there a better/elegant way? Is it OK to have multiple Ext.onReady functions in the code?