ExtJS-在按钮组中居中项目
我不知道该怎么做,ExtJS-在按钮组中居中项目,extjs,extjs4,markup,Extjs,Extjs4,Markup,我不知道该怎么做,buttonAlign:'center'或pack:'center'都在工作。小提琴:试试: Ext.onReady(function() { var panel = Ext.create('Ext.form.Panel', { renderTo: Ext.getBody(), title: 'Button group', border: true, layout: { align: 'middle', pac
buttonAlign:'center'
或pack:'center'
都在工作。小提琴:试试:
Ext.onReady(function() {
var panel = Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
title: 'Button group',
border: true,
layout: {
align: 'middle',
pack: 'center',
type: 'hbox'
},
width: 500,
items: [{
xtype: 'buttongroup',
columns: 1,
items: [{
xtype: 'button',
text: 'Go'
}, {
xtype: 'button',
text: 'Reset'
}]
}]
});
});
要将按钮并排放置,请删除
列:1
-还要注意,JSFIDLE上的Ext JS实现非常糟糕,因此不要过分依赖它。您是否考虑过使用面板底部的工具栏
(没有mvc模式)
您也可以使用类似以下内容:
dockedItems: [{
xtype: 'toolbar',
layout: {
pack: 'center'
},
defaultButtonUI: 'default', // get default look and feel
dock: 'bottom',
items: [{
xtype: 'button',
width: 200,
text: 'Download to Excel',
},{
xtype: 'button',
width: 200,
text: 'Another action',
}]
致以最诚挚的问候。使用buttongroup的属性:
layout: {
type: 'vbox',
align: 'center'
}
请参阅叉形提琴:Hm,有没有不使用固定工具栏而将其居中的方法?