1:formPanel里的元素居中显示
Ext.onReady(function () {
Ext.QuickTips.init();
// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';
var top = new Ext.FormPanel({
labelAlign: 'right',
frame:true,
width: 600,
items: [{
layout:'column',
items:[{
columnWidth:.33,
layout: 'form',
items: [{
xtype:'label',
html: ' ',
name: 'first',
anchor:'95%'
}, {
xtype:'label',
html: ' ',
name: 'company',
anchor:'95%'
}]
},{
columnWidth:.33,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: 'Last Name',
name: 'last',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Email',
name: 'email',
vtype:'email',
anchor:'95%'
}]
},{
columnWidth:.33,
layout: 'form',
items: [{
xtype:'label',
html: ' ',
name: 'first',
anchor:'95%'
}, {
xtype:'label',
html: ' ',
name: 'company',
anchor:'95%'
}]
}]
}]
});
top.render(document.body);
});
如图:
![spacer.gif](/e/u/themes/default/p_w_picpaths/spacer.gif)