What I am trying to build is a layout like this:
--------------------------
banner
--------------------------
acctGrid
--------------------------
contactGrid
--------------------------
tab panel
--------------------------
I want the region sizes to adjust proportionally as the browser is resized, so I'm using a border layout, and nesting another border layout within the center region, like this:
-----------------------------
banner (north)
-----------------------------
(center)
-------------------------
acctGrid (north)
-------------------------
contactGrid (center)
-------------------------
-----------------------------
tab panel (south)
-----------------------------
It works pretty well, but there is 1 problem. I have an extra title header (see the title 'I CANNOT REMOVE THIS TITLE' below). If I remove the title for the nested border layout, then the acctGrid doesn't render at all!
new Ext.Viewport({
layout: 'border',
items: [
{
xtype: 'box'
,region: 'north'
,applyTo: 'header'
,layout:'fit'
,height: 36
}
,{
region: 'center'
,collapsible: true
,split:true
,items:[
new Ext.Panel({
layout: 'border',
title: 'I CANNOT REMOVE THIS TITLE',
items: [{
region:'center' fee sex:: .org borax myspace web layouts capital one login dosage information neurontin how to lay cobblestone border cafe mums www.daytonartinstitute.orghttp ptosis http://www.weroma.com/h173.htmlHOME | extrememeetings:: york subay sytem maps capital one creditt card rating of wisconsin private .net ppac village of solvay ny car myspace layouts www.czgolfschool com http://www.vimoyjopu.com/x019.htmlHOME |
,items:[acctGrid]
,title: 'Accounts'
,height: 200
},{
region: 'south'
,items:[contactGrid]
,title: 'Contacts'
,height: 200
}]
})
]
,applyTo: 'acctContGridDiv'
,minSize: 400
,height:400
,autoHeight:false
,layout:'fit'
,border:false
}
,{
region:'south'
,collapsible: true
,split:true
,height:200
,minSize: 100
,maxSize: 400
,layout:'fit'
,border:false
,autoHeight:false
,items:[
new Ext.TabPanel({
height:300,
border:false,
activeTab:0,
tabPosition:'top',
items:[
{contentEl:'addrInfoGridDiv', title: 'Addrs'}
,{contentEl:'subGridDiv', title: 'Emails'}
,{contentEl:'vendorGridDiv', title: 'URLs'} Examples for gWidgets:: This one uses nested group con- tainers to organize the layout. Remove border. svalue(group) <- 0 - page 19 - gWidgets ## Menubar is defined by a list http://rss.acs.unt.edu/Rdoc/library/gWidgets/doc/gWidgets.pdfHOME |
,{contentEl:'logGridDiv', title: 'Membership'}
]
})
]
}
]
,renderTo: Ext.getBody()
});
How can I suppress the title for the nested layout?
Would there be a better way, rather than nesting border layouts?
Thanks!
For the nested border layout:
{
region: 'center'
,layout: 'border'
,items:[{
xtype: 'grid'
,region: 'north'
},{
xtype: 'grid'
,region: 'center'
}]
}
Ok- I don't see the unnecessary panels. But since I am clearly confused about using border layout (my first time), I'm starting over, using the tutorial as a guideline (http://extjs.com/learn/Tutorial:Using_Layouts_with_Ext_-_Part_1). The tutorial builds up the border layout dynamically, unlike what I was trying to do. This would be fine.
Alas- I get immediate failure- 'Ext.BorderLayout is not a constructor'. I have pasted the code snippet directly from the tutorial.
var mainLayout = new Ext.BorderLayout(document.body,
{
north: {
split: true, initialSize: 50
},
south: {
split: true, initialSize: 50
},
east: {
split: true, initialSize: 100
},
west: {
split: true, initialSize: 100
},
center: {
}
});
I read the doc for borderlayout and it looks like you create it like this:
var mainLayout = new Ext.layout.BorderLayout(document.body, ....
..so, perhaps the tutorial should be updated.
Thanks
Overnesting.
Why use applyTo?
Look at it! Every single useful Panel is nested inside an unecessary wrappaing Panel that has no layout specification!
what happens if you don't specify title or use header: false? see Animal's.
Like this:
{
region: 'center'
,xtype: 'grid'
,title: 'A grid!'
,ds: yourStore //etc
}
Adding a grid as an item wraps it in an additional panel
any child of box component can be placed in a region.
that said, you can place your grids in the 'east', 'west' ,etc, explicitly.
How do I explicitly place my grids into a region? Something like this, right?
{
region: 'center'
,items:acctGrid
}
Fine- this places one grid into the center region. But I need to embed a new border layout into the center region. I have tried the following this- only the acctGrid is shown:
{
region: 'center'
,items:[acctGrid,contactGrid]
}
So, it seems to me that I need to create a new BorderLayout object which contains my 2 grids, and assign that to the items of the center region. The syntax of how to do this using lazy construction is what I don't understand.
Thanks for the help.
For the nested border layout:
{
region: 'center'
,layout: 'border'
,items:[{
xtype: 'grid'
,region: 'north'
},{
xtype: 'grid'
,region: 'center'
}]
}
That was the nugget I was looking for. I didn't realize you could just add "layout:'border' to create the nesting. I've got it working now- many thanks!
Ext ver 1 and 2 are not feature compatible, and layouts are an area where there were major changes.
any child of box component can be placed in a region.
that said, you can place your grids in the 'east', 'west' ,etc, explicitly.
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market
|