Hello,
I don´t know how to refresh the content of an Ext.Window. I know, that I could use window.close(); but I use the window inside a popup function and if I try to open the Ext.Window again the Ext.get function can´t load the component any more. I get the firebug message "TypeError: Ext.getCmp(...) is undefined"
So I just hide the window instead of closing it, but if I open another popup and then the Ext.Window it shows the old content of the feature before.
Here´s a little bit of code, the popup function and the Ext.Window "inside" the popup:
function createPopup_3(feature) {
var gallerycontent =
"<b>Gallerycontent</b>" + feature.attributes.openshop +
"<a href='#' onclick='Ext.getCmp(\"picwin\").hide();'>HIDE BOX</a><br>"
;
var picwindow = new Ext.Window({
id: 'picwin',
title: feature.attributes.name,
html: gallerycontent,
});
picwindow.on('hide', function() {this.refresh();}); // How can I "refresh" the html gallerycontent of the Ext.Window on hiding it??? this.update just clears the content
I know, that I could use window.close(); but I use the window inside a popup function and if I try to open the Ext.Window again the Ext.get function can´t load the component any more. I get the firebug message "TypeError: Ext.getCmp(...) is undefined"
Ext.getCmp results undefined because it can not get any component with your passed id as your window is already destroyed when you have closeed it.
try to make a new instance when opening it again rather than finding previous one and setting its content.
However, for your current problem, you may use update function for your window to update its content, just pass your html as an argument.