PDA

View Full Version : Hide DockedItem



frankbolviken
23 Feb 2012, 2:59 AM
Hi,

I'm trying to hide a dockeditem from view, but I can't remove it completely. The component itself is removed, but the "area" in which the component where remains, only filled with white. Is there any way off completely hiding dockeditems from view?
I've tried removeDocked, hide, setVisible etc. I need to be able to show it again at a later stage.

Frank

mitchellsimoens
23 Feb 2012, 8:21 AM
This was fixed in 4.1.0. I tested using this example:


new Ext.panel.Panel({
renderTo : document.body,
width : 400,
height : 400,
dockedItems : [
{
xtype : 'toolbar',
dock : 'top',
items : [
{
text : 'Hide',
handler : function(btn) {
var panel = btn.up('panel'),
dock = panel.down('toolbar[dock=bottom]');

dock.hide();
}
},
{
text : 'Show',
handler : function(btn) {
var panel = btn.up('panel'),
dock = panel.down('toolbar[dock=bottom]');

dock.show();
}
}
]
},
{
xtype : 'toolbar',
dock : 'bottom',
items : [
{
text : 'Hello'
}
]
}
]
});

The panel's body resizes properly.

chramer
23 Feb 2012, 11:37 PM
you can use "forceComponentLayout()"..
my sample here (http://jsfiddle.net/serju/rJ5zV/4/)