PDA

View Full Version : Redrawing layout of component after hiding element



meyerovb
21 Jul 2010, 8:58 AM
In the below example, after clicking the second button and hiding the first button, how do I re-render the component to move the second button up to the position of the first docked element?



Ext.setup({ onReady: function () {
new Ext.Panel({ fullscreen: true,
dockedItems: [
{ dock: 'top', xtype: 'button', id: 'but1', text: 'But1' },
{ dock: 'top', xtype: 'button', text: 'Hide But1',
handler: function () { Ext.getCmp('but1').hide(); }
}]
});
}});

evant
21 Jul 2010, 9:05 AM
Ext.setup({
onReady: function(){
var p = new Ext.Panel({
fullscreen: true,
dockedItems: [{
dock: 'top',
xtype: 'button',
id: 'but1',
text: 'But1'
}, {
dock: 'top',
xtype: 'button',
text: 'Hide But1',
handler: function(){
Ext.getCmp('but1').hide();
p.doComponentLayout();
}
}]
});
}
});

meyerovb
21 Jul 2010, 9:18 AM
Thanks, works perfectly! This method is marked as private and not shown in the documentation. Will it be exposed as public?

evant
21 Jul 2010, 6:01 PM
It's becoming apparent that it should be yes, maybe not that method directly, but something that fires it.