gpt4 book ai didi

layout - extjs 字段布局问题

转载 作者:行者123 更新时间:2023-12-02 08:25:52 30 4
gpt4 key购买 nike

我在表单上显示字段时遇到问题

var test = Ext.create('Ext.form.Panel', {
renderTo: 'test',
title: '1. zzzz',
width: 800,
bodyPadding: 5,


defaults: {
anchor: '100%'
},
items: [
{
xtype: 'fieldset',
defaults: {
anchor: '100%'
},
layout: 'column',
items: [
{
xtype: 'panel',
fieldDefaults: {
msgTarget: 'side',
labelWidth: 75

},
columnWidth: .5,
flex: 1,
defaultType: 'textfield',
defaults: {
anchor: '100%',
flex: 1
},
items: [
{
xtype: 'numberfield',
hideTrigger: true,
fieldLabel: 'zzzz',
//anchor: '100%',
//anchor: '-5',
name: 'SRD_NUMBER'
},
{
fieldLabel: 'zzzz',
//anchor: '-5',
name: 'SRD_NAME_BR'
},
{
fieldLabel: 'zzzzz',
//anchor: '-5',
name: 'SRD_NAME_FL'
},
{
xtype: 'numberfield',
hideTrigger: true,
fieldLabel: 'zzzz',
disabled: true,
//anchor: '-5',
name: 'SRD_FOP'
},
{
fieldLabel: 'zzzz',
//anchor: '-5',
name: 'SRD_NAME_ORDER'
},
{
xtype: 'panel',
id: 'dep-img',
border: false,
height: 50,
width: 100,
cls: 'x-form-item',
html: '<img src="http://dep-image/id/10000001482" width="100" height="50" title="zzz">'
},
{
xtype: 'filefield',
name: 'file1',
msgTarget: 'side',
border: 3,
//anchor: '100%',
fieldLabel: 'zzzz',
buttonText: 'zzzzzz'
},
{
fieldLabel: 'zzz',
//anchor: '-5',
name: 'company'
},
{
fieldLabel: 'zzzz',
//anchor: '-5',
name: 'company'
}]
}
]
} //fieldset
]//glob

});

我需要使字段宽度适合列宽。

在此页面上http://docs.sencha.com/ext-js/4-0/#/api/Ext.form.FieldContainer 2个例子在第二个例子中,他们设置了 defaults {layout: '100%'}而且看起来它不起作用。

找到了自己的救赎:通过将布局:'fit'或布局:'anchor'添加到字段集 anchor 默认值:{ 布局:“适合”, 弹性:1},

感谢大家

最佳答案

您必须为您的表单设置height属性,如果它仍然没有显示,则也为字段集提供高度。

关于layout - extjs 字段布局问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6678546/

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