admin 管理员组

文章数量: 1087139


2024年5月10日发(作者:edg电子竞技俱乐部微博)

利用formpanel的form和column属性混合使用来实现横线布局,效果图如下:

var hform = new nel({

items : [{ // 行1

layout : "column", // 从左往右的布局

items : [{

columnWidth : .3, // 该列有整行中所占百分比

layout : "form", // 从上往下的布局

items : [{

}]

columnWidth : .3,

layout : "form",

items : [{

}]

columnWidth : .3,

layout : "form",

items : [{

xtype : "textfield",

fieldLabel : "名",

width : 120

xtype : "textfield",

fieldLabel : "姓",

width : 120

title : "灵活布局的表单",

width : 650,

autoHeight : true,

frame : true,

renderTo : y(),

layout : "form", // 整个大的表单是form布局

labelWidth : 65,

labelAlign : "right",

}, {

}, {

}]

}]

xtype : "textfield",

fieldLabel : "英文名",

width : 120

}, { // 行2

layout : "column",

items : [{

}]

columnWidth : .46,

layout : "form",

items : [{

}]

columnWidth : .46,

layout : "form",

items : [{

}]

xtype : "textfield",

fieldLabel : "座右铭2",

width : 200

xtype : "textfield",

fieldLabel : "座右铭1",

width : 200

}, {

}, {// 行3

layout : "form",

items : [{

}]

xtype : "textfield",

fieldLabel : "奖励",

width : 500

xtype : "textfield",

fieldLabel : "处罚",

width : 500

}, {

}, {// 行4

layout : "column",

items : [{

layout : "form",

columnWidth : 0.2,

items : [{

xtype : "textfield",

fieldLabel : "电影最爱",

width : 50


本文标签: 布局 实现 横线 使用 电子竞技