我在利用Extjs4在同一个页面做2个window报表,这两个window有各自独立的呼叫按钮,现在碰到一个问题两个window 多次切换后,第一个调出的window A内的内容不出现了, 而第二个window B 就可以正常显示,如果A,B叫出顺序互换,就会变成B 第二次无法显示内容.请问是我哪里出问题了.
第一个window的第一次调出:

第二个window的第一次调出:

第一个window 的第二次调出:

第二个window 的第二次调出:
下面是两个window 的呼叫方式:
button = Ext.get('Button5');
button.on('click', function() {
var btn = document.getElementById("Button5");
btn.innerText = "Hidden";
store1.load({ params: { sql: pl_sql} });
//donut = (donut) ? false : 35;
if (!win) {
win = Ext.create('Ext.window.Window', {
width: 800,
height: 400,
minHeight: 200,
minWidth: 550,
hidden: false,
maximizable: true,
title: 'Total List',
autoDestroy: true,
//autoShow: true,
layout: 'fit',
closeAction: 'hide',
tbar: [{
text: 'Save Chart',
handler: function() {
Ext.MessageBox.confirm('Confirm Download', 'Would you like to download the chart as an image?', function(choice) {
if (choice == 'yes') {
chart.save({
type: 'image/png'
});
}
});
}
}, {
text: 'Reload Data',
handler: function() {
// Add a short delay to prevent fast sequential clicks
store1.load({ params: { sql: pl_sql} });
}
}],
items: chart
});
}
button.dom.disabled = true;
if (win.isVisible()) {
win.hide(this, function() {
button.dom.disabled = false;
btn.innerText = "Show View";
});
} else {
win.show(this, function() {
button.dom.disabled = false;
btn.innerText = "Hidden";
});
}
});
button1 = Ext.get('Button6');
button1.on('click', function() {
btn6.innerText = "Hidden";
store1.load({ params: { sql: pl_sql1} });
//donut = (donut) ? false : 35;
if (!win1) {
win1 = Ext.create('Ext.window.Window', {
width: 800,
height: 400,
minHeight: 200,
minWidth: 550,
hidden: false,
maximizable: true,
autoDestroy: true,
title: "Show" + " " + myDate.getFullYear(),
//autoShow: true,
layout: 'fit',
closeAction: 'hide',
tbar: [{
text: 'Save Chart',
handler: function() {
Ext.MessageBox.confirm('Confirm Download', 'Would you like to download the chart as an image?', function(choice) {
if (choice == 'yes') {
chart.save({
type: 'image/png'
});
}
});
}
}, {
text: 'Reload Data',
handler: function() {
// Add a short delay to prevent fast sequential clicks
store1.load({ params: { sql: pl_sql1} });
}
}],
items: chart
});
}
button1.dom.disabled = true;
if (win1.isVisible()) {
win1.hide(this, function() {
button1.dom.disabled = false;
btn6.innerText = "Show" + " " + myDate.getFullYear();
});
} else {
win1.show(this, function() {
button1.dom.disabled = false;
btn6.innerText = "Hidden";
});
}
});