Javascript 在外部面板中的项目之间添加边距
我有一个有两个按钮的面板,在另一个面板内使用。现在它正确地呈现按钮,但我想在它们之间添加一个边距。如何正确配置布局以实现此目的Javascript 在外部面板中的项目之间添加边距,javascript,css,layout,extjs,extjs4,Javascript,Css,Layout,Extjs,Extjs4,我有一个有两个按钮的面板,在另一个面板内使用。现在它正确地呈现按钮,但我想在它们之间添加一个边距。如何正确配置布局以实现此目的 return Ext.create('Ext.panel.Panel', { width: 220, height: 35, border: false, collapsible: false, renderTo: renderTo, items : [
return Ext.create('Ext.panel.Panel', {
width: 220,
height: 35,
border: false,
collapsible: false,
renderTo: renderTo,
items : [
{
xtype: 'button',
scale: 'medium',
text: this.exportButtonText,
handler: function() {
var form = this.form.getForm();
if (form.isValid()) {
var values = form.getValues();
form.reset();
this.plugin.printSettings = values;
this.progressBar.show();
this.plugin.doPrint();
}
},
scope: this
},
{
xtype: 'button',
scale: 'medium',
text: this.cancelButtonText,
handler: function() {
me.close();
},
scope: this
}
]
});
在它们之间添加以下内容:
{
xtype: 'tbspacer',
flex: 1
}
在它们之间添加以下内容:
{
xtype: 'tbspacer',
flex: 1
}
或将其添加到左按钮定义中:
{
margin: '0 5px 0 0'
}
或将其添加到左按钮定义中:
{
margin: '0 5px 0 0'
}