View Full Version : on(load) function

2 Aug 2012, 1:25 AM
Is it possible to find the exact moment when a component is finished loading?
I create an Ext.Window, and then need to 'do stuff', but it is vital to wait until the window and its components (panels and charts) are finished loading.
I thought something like the following might work, but nothing is happening:

mywindow.on('load', function() {
console.log('window LOADED!');

For the record, my window is defined as follows:

mywindow = new Ext.Window({
height: 600,
width: 800,
closeAction: 'hide',
layout: "anchor",
items: [panel1,panel2, panel3],

I have a pretty unsatisfactory temporary work-around, independent of the window loading, by using a timeout:

//do stuff

I would really like the application to 'do stuff' as soon as the window is ready to go, instead of just waiting an arbitrary amount of time. The window might not even be ready by the end of the timeout in some cases, so that would mess things up!
Any suggestions?
Many thanks,


3 Aug 2012, 4:56 AM

You can use afterrender event or show event of ext window like:

myWindow.on('show', this.onWindowShow,this);

It depends what you want to do.