gpt4 book ai didi

forms - ExtJS - 在 FormPanel 列布局中排列表单元素

转载 作者:行者123 更新时间:2023-12-04 01:47:48 25 4
gpt4 key购买 nike

我有一个包含 3 列的 FormPanel。每列是 FormPanel 宽度的 33%。看起来像这样:

searchForm = new Ext.FormPanel({
frame: true,
title: 'Search Criteria',
labelAlign: 'left',
labelStyle: 'font-weight:bold;',
labelWidth: 85,
width: 900,
items: [{
layout: 'column',
items: [{ // column #1
columnWidth: .33,
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: 'Banner ID',
name: 'bannerID',
anchor: '95%',
},
new Ext.form.ComboBox({
fieldLabel: 'Advertiser',
typeAhead: true,
triggerAction: 'all',
mode: 'local',
emptyText: 'Advertiser',
store: advertiserList,
valueField: 'id',
displayField: 'name'
})] // close items for first column
}, {
columnWidth: .33,
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: 'Banner Name',
name: 'bannerName',
anchor: '95%',
},
new Ext.form.ComboBox({
fieldLabel: 'Art Type',
typeAhead: true,
triggerAction: 'all',
mode: 'local',
emptyText: 'Art Type',
store: artTypesList,
valueField: 'id',
displayField: 'name'
})] // close items for second column
}, {
columnWidth: .33,
layout: 'form',
items: [{
xtype: 'hidden'
},
new Ext.form.ComboBox({
fieldLabel: 'Art Size',
typeAhead: true,
triggerAction: 'all',
mode: 'local',
emptyText: 'Art Size',
store: artSizeList,
valueField: 'id',
displayField: 'name'
})] // close items for third column
}]
}]
}); // close searchForm FormPanel

它显示了如下所示的内容:
Screenshot

唯一的问题是我希望“艺术尺寸”字段/标签与“广告商”和“艺术类型”字段在同一行上对齐。有什么方法可以添加一个“空白”项目,以便它强制输入到正确的行?有没有另一种方法来解决这个问题?

谢谢!

编辑:
这有效:

{
xtype: 'component',
fieldLabel: ' ',
labelSeparator: ' ',
}

最佳答案

默认情况下,空标签是隐藏的(该字段被推到左边)。
而不是把 ' '标签 ...

fieldLabel: ' ',
labelSeparator: ' ',

你可以正确地做到这一点:
hideEmptyLabel : false

即使没有指定标签,女巫也会对齐您提交的组件。

关于forms - ExtJS - 在 FormPanel 列布局中排列表单元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6332732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com