PDA

View Full Version : Cleaning not needed DOM nodes - proper way



drian
30 Jan 2011, 9:18 AM
Hi, i'm new to ExtJs and I'm having troubles cleaning up the unused DOM nodes that extjs creates for components (window, grid, etc).

Here's a simple example of the issue:

I have a border layout - header(for the menu) + center (for the content). In the center region I load external pages using .load or (with .getUpdater() and then .update()). The loaded files have some javascript which creates a window for example.

The window is rendered by default to the body (i'm not using any renderTo, because i want it to be modal on all the screen) and needs to be re-usable(so i don't destroy it, i just hide it when i chick the close button). After loading the first page, i load the second one. At this time, i do not need ANY of the components that were created by the first page. How do i get rid of the window from the first loaded page??

I'm looking for a global and dinamically solution, as it's not possible to destroy() all components from a page as I would have to know every component's name and this is not viable.

Am i doing something wrong? What is the proper way of handling this issue?


Thank you!