我发现用列布局显示文本标签是不可能的。我尝试了很多配置。标签字段仍未显示。这是我的代码:
var contactPanel = new Ext.form.FormPanel(
{
bodyStyle:"padding:5px",
items:
[
{xtype:"fieldset",title:"Customer",html:"XXX COMPANY LIMITED"},
{xtype:"fieldset",title:"Contact Person",items:[
new Ext.Panel
({
bodyStyle:"padding:0px 0px 0",labelAlign:'right',border:false,items:
[{
layout:"column",border:false,defaults:{border:false,defaults:{xfield:"form",defaultType:'textfield',anchor:'95%'}},
items:[
{columnWidth:.05,html:"<span style='font-size:14px;position:absolute;'>English Name</span>"},
{columnWidth:.25,items:[new App.common.ArrayComboBox({width:120,fieldLabel: "Title", data:['Dr','Mr','Ms'], value:2})]},
{columnWidth:.35,items:[{width:220,fieldLabel:'Surname',xtype:'textfield',value:"Lau"}]},
{columnWidth:.35,items:[{fieldLabel:'Given Name',xtype:'textfield',value:"Alan"}]},
{columnWidth:.7,items:[{fieldLabel:'Customer Name',xtype:'textfield'}]},
{columnWidth:.5,items:[{fieldLabel:'Responsibility',xtype:'textfield'}]}
]
}]
})
]}
]
});
答案 0 :(得分:1)
标签显示在“表单”布局的面板中。尝试将内部面板的默认值修改为此(添加布局:'form'):
defaults:{border:false, layout: 'form',defaults:{xfield:"form",defaultType:'textfield',anchor:'95%'}}