PDA

View Full Version : fieldcontainer only works with layout : hbox ?



dedoz
27 Jan 2012, 11:21 PM
heres the documentation with live example
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.FieldContainer (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.form.FieldContainer)

tried to change the layout to vbox (editing the live code example) to arrange fields in a vertical way, and shows nothing, not even an error.

FieldContainer only works with hbox layout ?

josephkirubakaran
27 Jan 2012, 11:53 PM
Am not much familiar with FieldContainer. However the layout 'anchor' is able to arrange those fields in a vertical way.



Ext.create('Ext.form.Panel', {
title: 'FieldContainer Example',
width: 550,
bodyPadding: 10,

items: [{
xtype: 'fieldcontainer',
fieldLabel: 'Last Three Jobs',
labelWidth: 100,

// The body area will contain three text fields, arranged
// horizontally, separated by draggable splitters.
layout: 'anchor',
items: [{
xtype: 'textfield',
flex: 1
}, {
xtype: 'splitter'
}, {
xtype: 'textfield',
flex: 1
}, {
xtype: 'splitter'
}, {
xtype: 'textfield',
flex: 1
}]
}],
renderTo: Ext.getBody()
});

josephkirubakaran
28 Jan 2012, 12:07 AM
Also vbox is working when you provide height.


Ext.create('Ext.form.Panel', {
title: 'FieldContainer Example',
width: 550,
bodyPadding: 10,

items: [{
xtype: 'fieldcontainer',
fieldLabel: 'Last Three Jobs',
labelWidth: 100,
height:100,

// The body area will contain three text fields, arranged
// horizontally, separated by draggable splitters.
layout: 'vbox',
items: [{
xtype: 'textfield',
flex: 1
}, {
xtype: 'splitter'
}, {
xtype: 'textfield',
flex: 1
}, {
xtype: 'splitter'
}, {
xtype: 'textfield',
flex: 1
}]
}],
renderTo: Ext.getBody()
});

dedoz
28 Jan 2012, 12:08 AM
you again, next time ill ask you directly , ill be your nightmare.

thank you very much.