PDA

View Full Version : how to destroy all window components on close



vayumahesh
12 Sep 2008, 5:57 AM
I am working on a Desktop application. When I close the window, it looks like all components of the window (Tree Panel, Tab Panel, Form Panel etc.,) are not properly destroyed.

After close, when I click on the desktop icon to open window, I am getting error like 'htmlfile: unspecified error' on line 10 of ext-base.js. If I try to open one more time, I am getting same error but window opens without any components.

Here is the removeWin function in my desktop.js file.

function removeWin(win){
taskbar.removeTaskButton(win.taskButton);
//win.remove(); //has no effect
//win.destroy(); //has no effect
layout();
}

I tried adding win.remove() and win.destroy() statements but no luck. How do I properly destroy the entire window including all the components ?

vayumahesh
12 Sep 2008, 10:13 AM
I figured it out. I had the definitions for Tab Panel, Tree Panel etc., outside createWindow() function. When I moved those inside and modified the calls on components to use Ext.getCmp('cmpId'), everything started working.

On initial page load it was working as the definitions were loaded right before the function was called.