PDA

View Full Version : Need Help with nested Layout



zieli1
17 Aug 2007, 3:38 AM
Hello!

I've created a nested Layout



var layout = new Ext.BorderLayout(document.body, {
north: {
split:false,
initialSize: 29,
titlebar: false
},
west: {
split:true,
initialSize: 250,
titlebar: true,
collapsible: true,
autoScroll: true,
minSize: 160,
maxSize: 400
},
center: {
autoScroll: false,
tabPosition: 'top'
}
});

layout.beginUpdate();

layout.add('north', new Ext.ContentPanel('top'));
layout.add('west', new Ext.ContentPanel('nav-tree', {title: '<b>Navigation</b>', closable:false}));
layout.add('west', new Ext.ContentPanel('nav-monitor', {title: '<b>Monitor</b>', closable:false}));
layout.getRegion('west').showPanel('nav-tree');

var innerLayout = new Ext.BorderLayout('content', {
south: {
split:true,
initialSize: 200,
minSize: 100,
maxSize: 400,
autoScroll:true,
collapsible:true,
titlebar: true
},
center: {
autoScroll:true
}
});

innerLayout.add('south', new Ext.ContentPanel('log', "<b>ITS Log</b>"));
innerLayout.add('center', new Ext.ContentPanel('main'));
layout.add('center', new Ext.NestedLayoutPanel(innerLayout));
layout.endUpdate();



There is also a Toolbar Navigation in the North Pannel.

when i click on a toolbar button i want to create a new panel in the inner Layout (center) but all i've tried doesn't work :-(

Can somebody help me??

carol.extjs
17 Aug 2007, 8:56 AM
n00b here, but I think it would help if you showed the context where you are trying to create the new panel. And an attempt that doesn't work.

What do you mean when you say it doesn't work? Nothing happens or you get javascript errors. Are you using firefox/firebug and looking at this in the debugger?

zieli1
19 Aug 2007, 11:17 PM
Hi!

This is the HTML Code

[code]
<div id ="container">
<!-- Topnavigation-->

<div id="top"></div>

<!-- Navigationtree -->

<div id="nav-tree">
<div id="tree-div"></div>
</div>

<div id="nav-monitor">

</div>

<!-- dummycontainer f

carol.extjs
20 Aug 2007, 11:56 AM
I've tried to add new panels to the "main" container but it doesnt work?!? - there also was no js error....

How about you show the javascript code that doesn't work? You already created a ContentPanel associated with div with ID = "main"...so not sure what you mean by main container (center?).



innerLayout.add('center', new Ext.ContentPanel('main'));