0

我有一个带有两个按钮的面板,用于另一个面板。现在它可以正确呈现按钮,但我想在它们之间添加一个边距。如何正确配置布局以获得这个?

在此处输入图像描述

    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 
            }                
        ]
    });
4

2 回答 2

3

或将此添加到左按钮定义:

{
   margin: '0 5px 0 0'
}
于 2012-06-29T10:27:26.573 回答
1

在它们之间添加:

{
 xtype: 'tbspacer',
 flex: 1
}
于 2012-06-29T08:55:45.327 回答