admin管理员组文章数量:1333442
I'm trying to reduce the padding between the fields of my ExtJS form.
I am able to change the style of the field data with the style tag in the Items collection like this:
//form right
var simple_form_right = new Ext.FormPanel({
frame:true,
labelWidth: 90,
labelAlign: 'right',
title: 'Orderer Information',
bodyStyle:'padding:5px 5px 0 0',
width: 300,
height: 600,
autoScroll: true,
itemCls: 'form_row',
defaultType: 'displayfield',
items: [{
fieldLabel: 'Customer Type',
name: 'customerType',
style: 'padding:0px;font-size:7pt',
labelStyle: 'padding:0px',
allowBlank: false,
value: 'Company'
},{
fieldLabel: 'Company',
name: 'pany',
value: 'The Ordering Company Inc.'
},{
fieldLabel: 'Last Name',
name: 'lastName',
value: 'Smith'
}, {
...
But how do I access the style of the label as well, something like styleLabel or labelStyle, etc.?
I'm trying to reduce the padding between the fields of my ExtJS form.
I am able to change the style of the field data with the style tag in the Items collection like this:
//form right
var simple_form_right = new Ext.FormPanel({
frame:true,
labelWidth: 90,
labelAlign: 'right',
title: 'Orderer Information',
bodyStyle:'padding:5px 5px 0 0',
width: 300,
height: 600,
autoScroll: true,
itemCls: 'form_row',
defaultType: 'displayfield',
items: [{
fieldLabel: 'Customer Type',
name: 'customerType',
style: 'padding:0px;font-size:7pt',
labelStyle: 'padding:0px',
allowBlank: false,
value: 'Company'
},{
fieldLabel: 'Company',
name: 'pany',
value: 'The Ordering Company Inc.'
},{
fieldLabel: 'Last Name',
name: 'lastName',
value: 'Smith'
}, {
...
But how do I access the style of the label as well, something like styleLabel or labelStyle, etc.?
Share Improve this question edited Apr 27, 2011 at 11:18 Edward Tanguay asked Apr 27, 2011 at 10:23 Edward TanguayEdward Tanguay 193k320 gold badges725 silver badges1.1k bronze badges 1- Oh please... don't post code samples as images. – Rene Saarsoo Commented Apr 27, 2011 at 11:14
2 Answers
Reset to default 2There's labelPad
which defaults to 5px apparently, and labelStyle
if you need more than that.
You can make use of the labelStyle
property available for form fields.
Here is an example:
items: [{
fieldLabel: 'Company',
name: 'pany',
labelStyle: 'padding: 10px 10px;'
}]
本文标签: javascriptHow to reduce the padding of the labels in an ExtJS FormPanelStack Overflow
版权声明:本文标题:javascript - How to reduce the padding of the labels in an ExtJS FormPanel? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742287361a2447169.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论