tags:

views:

168

answers:

2

I'm studying extjs now.

new Ext.Viewport({
layout: 'border',
items: [{
    region: 'north',
    html: '<h1 class="x-panel-header">Page Title</h1>',
    autoHeight: true,
    border: false,
    margins: '0 0 5 0'
},...

i could not find 'region' property in the API.

i checked viewport, component and other classes. i could not find it.

A: 

As http://yui-ext.com/forum/showthread.php?t=56801 states,
"regions are part of BorderLayouts"

amartynov
by the way, where does the value of this region come from? thanks
bgreen1989
A: 

You are correct, the 'region' attribute is not a direct attribute of Viewport itself, but an attribute of the regions you are assigning to your Viewport.

Each Viewport must contain at least two regions. These regions are defined as part of the Ext.layout.BorderLayout.Region class (http://extjs.com/deploy/dev/docs/?class=Ext.layout.BorderLayout.Region). Basically, you can have 'north','east','south' and 'west' regions, in combination with a 'center' region. You can have all or those, or just one, as long as you also have your 'center' region. The 'center' region will automatically resize to take up whatever remaining space you do not define as part of your other regions.

Steve -Cutter- Blades