PDA

View Full Version : panel setvisible not working in safari



vitolini
17 Apr 2011, 11:58 AM
I have 3 child panels inside a parent panel, i show only 1 panel at any time, hiding others when activating one. Code works fine in Safari, IE7, IE8 but it doesn't work in safari (if anything i'd expect IE to fail not safari) It's a big code but i post relevant parts only...

Initial config... Only search panel is visible



reportSearch = new Ext.Panel({
contentEl:'reportSearch'
});

reportSummary = new Ext.Panel({
title: 'Results',
contentEl:'reportSummary',
hidden: true,
layout: 'anchor',
items:[summaryGrid]
});

reportViewEdit = new Ext.Panel({
contentEl:'reportViewEdit',
hidden: true
});

reportsPanel = new Ext.Panel({
id: 'reportsPanel',
layout:'anchor',
title: 'Reports',
items: [reportSearch, reportSummary, reportViewEdit]
});
later i activate summary panel...


activatePanel(reportSummary);
console.log("search panel visible is " + reportSearch.isVisible());
console.log("summary panel visible is " + reportSummary.isVisible());

function activatePanel(panel)
{
for(var i=0; i< reportsPanel.items.length; i++)
{
if(reportsPanel.items.itemAt(i) != panel)
{
reportsPanel.items.itemAt(i).setVisible(false);
}
}
panel.setVisible(true);
panel.doLayout();
}
When the code runs.. In Firefox, it hides the search panel and shows the summary panel, and firebug console says

search panel visible is false
summary panel visible is true

in Safari it hides the search panel but doesn't show summary panel and inspector console says

summary panel visible is false
search panel visible is true


Am i doing something wrong?

Thanks in advance

vitolini
18 Apr 2011, 12:54 AM
Strange behaviour. I don't know how or why it happened. I was using Ext 3.2, just upgraded to 3.3.1 and problem seemed to be gone... In case it helps someone...