PDA

View Full Version : [SOLVED] form elements loose label



nadeemshafi9
4 Jun 2009, 5:53 AM
Hi guys

Why is it that when you put form elements inside a tab panel or give there container a layout they loose there default label ? anjd how do you get around it ?

thanks

conorarmstrong
4 Jun 2009, 5:58 AM
can we see some code?

nadeemshafi9
4 Jun 2009, 6:00 AM
heres some code but teh thing is that i tried label width on teh form but it doesent efect it i m putting it in a tab because i whant to put a textarea in the other tab for a description.




xtype: 'form',
columnWidth: 1,
labelWidth: 75,
id: 'updatemovieFormPanel',
border: false,
bodyStyle : 'padding:10px 10px 10px 10px;',
items: [{
xtype: 'tabpanel',
height: 610,
deferredRender: false,
activeItem: 'tab1',
id: 'tabPanel1',
border: false,
items: [{
id:'tab1',
title: 'Details',
listeners: {
activate: function(panel) {
panel.show();
}
},
items: [{
xtype: 'hidden',
name: 'id',
value: m[0].data.id
},{
xtype: 'textfield',
name: 'movie_type',
allowBlank: false,
emptyText: 'movie_type',
fieldLabel: 'movie_type',
value: m[0].data.movie_type
},{
xtype: 'textfield',
name: 'order',
allowBlank: false,
emptyText: 'order',
fieldLabel: 'order',
value: m[0].data.order
},{
xtype: 'textfield',
name: 'name',
allowBlank: false,
emptyText: 'name',
fieldLabel: 'name',
value: m[0].data.name
},{
xtype: 'textfield',
allowBlank: false,
name: 'source_type',
emptyText: 'source_type',
fieldLabel: 'source_type',
value: m[0].data.source_type
},{
xtype: 'textfield',
allowBlank: false,
name: 'url',
emptyText: 'url',
fieldLabel: 'url',
value: m[0].data.url
},{
xtype: 'textfield',
allowBlank: false,
name: 'desc',
emptyText: 'desc',
fieldLabel: 'desc',
value: m[0].data.desc
},{
xtype: 'textfield',
allowBlank: false,
name: 'img',
emptyText: 'img',
fieldLabel: 'img',
value: m[0].data.img
}]
}]
}]
}]
});
updatemovieWindow.show();

Animal
4 Jun 2009, 6:01 AM
As emphasized in the API documentation, labels are added around fields by the FormLayout layout manager.

Animal
4 Jun 2009, 6:01 AM
http://extjs.com/deploy/ext-3.0-rc2/docs/?class=Ext.Component&member=fieldLabel

nadeemshafi9
4 Jun 2009, 6:02 AM
so what your saying is once inside a tab panel teh labels will not be rendered by form layout anymore? and how do i get them to be rendered.

nadeemshafi9
4 Jun 2009, 6:04 AM
coool ok so i didnt know there was an explicit form layout ?? it works now that i gave the tab a form layout
layout:'form'