PDA

View Full Version : Help with layout and split



robtcallahan
23 Apr 2007, 9:30 AM
Hi folks,

I'm trying to do a simple layout which will be contained in another element.
I just want an east and west panel and the ability to resize them with
a center split. I can't figure it out. Spent last 3 hours reading forums, API,
source code, etc. Need help

Here's my javascript:
layout = new Ext.BorderLayout("foldertree-panel",
{
east:
{
initialSize:600,
minSize:175,
maxSize:800,
split: true,
titlebar: true,
autoScroll: false
},
west:
{
initialSize:300,
minSize:175,
maxSize:500,
split: true,
titlebar:true,
collapsible:true,
animate:true,
autoscroll: true
}
});

layout.beginUpdate();
layout.add("west", new Ext.ContentPanel("folders", {title:"Folders"}));
layout.add("east", new Ext.ContentPanel("details", {title: "Details"}));
layout.endUpdate();


here's the html:
<div id="foldertree-panel" style="border:1px solid #4391DA;overflow: hidden; width: 900px; height: 260px;">
<div id="folders" class="x-layout-inactive-content"></div>
<div id="details" class="x-layout-inactive-content"></div>
</div>

tryanDLS
23 Apr 2007, 10:04 AM
You have to have a center region. Make E-C or W-C and set split:true on only one of them.

bendy
23 Apr 2007, 10:07 AM
I believe you are required to have a center panel. Changing one of your panels to center should give you the same effect. I had the same thing with a north/south panel that would not work until I made it north/center. Looks the same though.

edit: You beat me to it Tim!

robtcallahan
23 Apr 2007, 10:33 AM
Thanks guys.
Funny, I was looking at a tree example and saw the exact layout that I wanted and it dawned on me...I bet a need a center! So, now it works.Duh!

Then I was about to post my finding when I saw your two posts.

Thanks again. I truely love Ext.
Can we get T-Shirts? :-)