PDA

View Full Version : Is it better to close or hide window from performance standpoint



jchau
6 Apr 2012, 7:21 AM
On a button click, I create a new window that contains a tree, grid, and tabpanel. From a performance / best practice standpoint, should I do:

A: recreate window on every button click and set window.closeAction: 'true'

B: create window if first time else reset window content and show hidden window. window.closeAction: 'hide'

Some things to consider:
1. Will keeping the window hidden use up a lot of browser memory due to lots of dom objects floating around?
2. Will recreating the window every time be a waste of time?

scottmartin
6 Apr 2012, 7:45 AM
If the window will be in use a lot, then I would hide it. You can use xtype rendering to load it only when needed,
but once you have it loaded, just keep it around and show it when needed.

Regards,
Scott.