PDA

View Full Version : Reload Panel after function add is used



ftr
24 Nov 2010, 3:37 AM
var pnl = new Ext.Panel({

});
function changeContent(config) {
pnl.add(new Ext.Panel(config);
}
changeContent({
title : 'this is a test'
});
When I add a control like this to an Panel the new created Panel is not shown until I resize the browser-window

Can anybody help me?

Gruss(no idea how to say this in english...) ftr

evant
24 Nov 2010, 3:41 AM
From the docs:



If the Container is already rendered when add is called, you may need to call doLayout to refresh the view which causes any unrendered child Components to be rendered. This is required so that you can add multiple child components if needed while only refreshing the layout once.