How to get access to a window that is loaded into a panel

Posted by Sandor Drieënhuizen on Stack Overflow See other posts from Stack Overflow or by Sandor Drieënhuizen
Published on 2010-03-28T23:00:01Z Indexed on 2010/03/28 23:03 UTC
Read the original article Hit count: 445

Filed under:

I'm loading an external script (that creates a new window component) into a panel, which works fine.

Now, I want to access the created window from a callback function to register a closed event handler. I've tried the following:

panel.load({
    scripts: true,
    url: '/createWindow',
    callback: function(el, success, response, options) {
        panel.findByType("window")[0].on("close", function { alert("Closed"); });
    }
});

However, the panel seems to be empty all the time, the findByType method keeps returning an empty collection. I've tried adding events handlers for events like added to the panel but none of them got fired.

So the question is: how do I access the window in the panel to register my close event handler on it?

© Stack Overflow or respective owner

Related posts about extjs