Thanks for the fix
It worked fine in the example and for one of my screens. Strangely though it didn't seem to work for another very similar screen that is seeing the same problem. I had assumed that the bug was the same for both and didn't provide two examples.
The difference in this one is that the Window has two panels and is using a vbox for the layout. The toolbars are then in the first component and not on the window. The same thing as before happens but in the first panel.
I attempted calling doComponentLayout() at different levels of this example but it didn't seem to have the same effect.
Am I missing something similar again?
Code:
var toggleToolbars = function() {
editToolbar.setVisible(editToolbar.hidden);
cancelToolbar.setVisible(cancelToolbar.hidden);
testWindow.doComponentLayout();
};
var editToolbar = new Ext.toolbar.Toolbar({
items: [
{
text: 'Edit',
scope: this,
handler: toggleToolbars
}
]
});
var cancelToolbar = new Ext.toolbar.Toolbar({
hidden: true,
items: [
{
text: 'Cancel',
scope: this,
handler: toggleToolbars
}
]
});
var testWindow = new Ext.window.Window({
title: 'Toolbar Test',
width: 800,
height: 600,
bodyPadding: 10,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [
{
flex: 1,
html: 'Section 1',
bbar: cancelToolbar,
tbar: editToolbar
},
{
flex: 1,
html: 'Section 2',
style: {'padding-top': '10px'}
}
]
});
testWindow.show();