remove tabs from DOM - browser memory usage
hello, im using this code to add tabs with iframes to tabpanel:
Code:
var addTab = function (tabPanel, id, tytul, url) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id: id,
title: tytul,
closable: true,
padding: 5,
autoLoad: {
showMask: true,
url: url,
mode: "iframe",
maskMsg: "Ładowanie " + tytul + "..."
}
});
tab.on("activate", function () {
var item = MenuPanel1.menu.items.get(id + "_item");
if (item) {
MenuPanel1.setSelection(item);
}
}, this);
tab.on("beforeclose", function () { Ext.getDom(TabPanel1.getActiveTab()).remove(); }, this);
}
tabPanel.setActiveTab(tab);
}
Problem is that browser memory usage is still groving even i close the tabs and reopen browser is taking more memory each time.
i tried with beforeclose event without luck.
How to clean DOM from closed tab? and maybe from other unused elements?