PDA

View Full Version : Rendering a form within a viewport region



adibhagra
5 Oct 2009, 3:22 AM
Hey all,

I have a form that i would like to display within the west region of my viewport,

however it does not allow me to specify my form within the items:[] object as var myForm = new Ext.FormPanel and if i use xtype:form and then create my form , i have problems later on accessing it .

can someone please tell me how to put my form within my west region.

my code is as follows:

Ext.onReady(function(){

var myForm = new Ext.FormPanel({
.
.
});

var viewport = new Ext.Viewport({

layout:'border',
items:[{
region:'north'
},
{
region:'west',
items:[{
// i want to display my form here
}
thanks and regards,

ice

Condor
5 Oct 2009, 3:37 AM
You are looking for:

{
region: 'west',
layout: 'fit',
items: [myForm]
}
but this would be overnested (uses an extra unneeded panel).

It would be better to use:

var myForm = new Ext.FormPanel({
region: 'west',
...
});
new Ext.Viewport({
layout:'border',
items:[{
region:'north'
}, myForm]
});

Animal
5 Oct 2009, 4:50 AM
You had the items config there already. Where was the blockage?

http://www.extjs.com/deploy/ext-3.0.0/docs/?class=Ext.Container&member=items

adibhagra
5 Oct 2009, 9:09 AM
thanks guys..