如上图所示。
我现在的做法如下:
var fieldSet2 = new Ext.form.FieldSet({
title:'基本信息',
//width:400,
height:260,
columnWidth: 1,
layout: 'column',
border: true,
anchor:'100%',
labelWidth: 60,
buttonAlign: 'center',
items:[{
columnWidth:.33,
layout: 'form',
border:false,
xtype:'fieldset',
autoHeight:true,
defaultType:'textfield',
items: [
{
xtype:'panel',
html:'<center>基本信息</center>'
}
]
},{
columnWidth:.67,
layout: 'form',
border:false,
xtype:'fieldset',
autoHeight:true,
defaultType:'textfield',
items: [
{
fieldLabel: '简介',
name: 'ccc',
anchor:'95%',
xtype:'textarea'
},{
fieldLabel: '开始时间',
name: 'ccc2',
anchor:'95%'
},{
fieldLabel: '结束时间',
name: 'ccc2',
anchor:'95%'
},{
fieldLabel: '分工界面',
name: 'ccc2',
anchor:'95%'
},{
fieldLabel: '关键要求',
name: 'ccc2',
anchor:'95%'
},{
fieldLabel: '前端点位',
name: 'ccc2',
anchor:'95%'
},{
fieldLabel: '中心点位',
name: 'ccc2',
anchor:'95%'
},{
fieldLabel: '其它信息',
name: 'ccc2',
anchor:'95%'
}
]
}]
});
上面代码所展示的图形如下:
问题:
1.如果能在我代码基础上实现,请指出需要修改添加的代码块
2.如果用其它方式实现,请给出代码块
由于对Extjs刚起步,需要解答详细些。
var fieldSet2 = new Ext.form.FieldSet({
title : '基本信息',
// width:400,
height : 260,
columnWidth : 1,
layout : 'border',
border : true,
anchor : '100%',
labelWidth : 60,
buttonAlign : 'center',
items : [{
region : 'west',
width : 200,
anchor : '100% 100%',
xtype : 'fieldset',
layout : 'fit',
defaultType : 'textfield',
items : [{
xtype : 'panel',
html : '
基本信息 |
首先你要对布局了解。
在开始时间和结束时间加个column布局
{
layout:'column',
defaults:{
layout:'form',
border:false,
columnWidth:.5
},
items:[{
xtype:'panel',
items:[{
fieldLabel: '开始时间',
name: 'ccc2',
anchor:'95%'
}]
},{
xtype:'panel',
items:[{
fieldLabel: '结束时间',
name: 'ccc2',
anchor:'95%'
}]
}
]}
你这个不是合并,而是分为2列。之前给的代码少了几个属性
{
layout : 'column',
xtype : 'panel',
defaults : {
layout : 'form',
border : false,
defaultType : 'textfield',
columnWidth : .5
},
items : [{
xtype : 'panel',
items : [{
fieldLabel : '开始时间',
name : 'ccc2',
anchor : '95%'
}]
}, {
xtype : 'panel',
items : [{
fieldLabel : '结束时间',
name : 'ccc2',
anchor : '95%'
}]
}]
}