Ext.application and Ext.override in launch function does not work?
I'm moving towards the ExtJS 4.0 MVC architecture and I had an override in my old init method which worked:
Old code that worked:
Code:
APP.app = function() {
...
return {
init: function() {
Ext.QuickTips.init();
Ext.override(Ext.Ajax.request, {
extraParams: {
param_1: Ext.get('my_id').getValue(),
param_2: Ext.get('my_id_2').getValue(),
param_3: Ext.get('my_id_3').getValue()
}
});
}
}
}
Ext.onReady(APP.app.init, APP.app);
New code that doesn't
Code:
Ext.application({
name: 'APP',
autoCreateViewport: true,
launch: function() {
Ext.override(Ext.Ajax.request, {
extraParams: {
param_1: Ext.get('my_id').getValue(),
param_2: Ext.get('my_id_2').getValue(),
param_3: Ext.get('my_id_3').getValue()
}
});
}
});
As you can see, I've moved this override to the launch function. You will also realize that I am retrieving my values from elements in the page after it has been loaded which is the reason for applying the override in the launch function.
Any help would be much appreciated.