Hello,
I was defining a window like:
Code:
var window = new Ext.Window({
....
});
window.on('beforeShow', function() {
...
});
Which was okay, but I need to extend Ext.Window now to fit in with the rest of an application. I've successfully extended Ext.Window for other components, but I've not needed to capture the beforeshow and show events before. I had a look that the extending Ext components tutorial and this is what I'm doing:
Code:
MyWindow = function() {
// Call parent constructor and pass the config...
MyWindow.superclass.constructor.call(this, {
...
});
this.on({
beforeshow: {
scope: this,
fn: function(component) {
Ext.Msg.alert('beforeShow...');
}
},
show: {
scope: this,
fn: function(component) {
Ext.Msg.alert('show...');
}
}
});
}
// Make the MyWindow extend the Ext.Window class...
Ext.extend(MyWindow, Ext.Window, {
// ::TODO:: Put other config stuff here...
});
I get the alert popup for the show event, but not the beforeshow event. I also don't get any popups if I put in onShow: or onBeforeShow: config params in the call to the super constructor either.
What am I doing wrong...?
Thanks,