PDA

View Full Version : Error during doLayout()



aviking
17 Oct 2009, 7:39 AM
Please anybody to tell me where is problem to dynamicaly display new Panel (altPanel) in viewport.


Ext.onReady(function(){

var toolBar = new Ext.Toolbar({
region: "north",
height: 150,
id: 'idPanelHeader',
title: 'AAA',
items: [{
xtype: 'tbbutton',
text: 'Button',
handler: function(){
var holder = Ext.getCmp('idViewport');
holder.remove('placeHolder');
holder.add(altPanel);
holder.doLayout();
}
}]
});

var mainPanel = new Ext.Panel({
id: "main",
region: "center",
title: "Main Title"
});

var rightPanel = new Ext.Panel({
id: "right",
region: "east",
title: "Right Title"
});

var altPanel = new Ext.Panel({
id: "alt",
region: "center",
title: "Alt Title"
});

var viewport = new Ext.Viewport({
layout: 'border',
id: 'idViewport',
items: [toolBar,
{
region: 'center',
id: 'placeHolder',
layout: 'border',
items: [rightPanel, mainPanel]
}]
});
});

Animal
18 Oct 2009, 10:02 AM
Read the notes at http://www.extjs.com/deploy/dev/docs/?class=Ext.layout.BorderLayout

See the FAQ also.