Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/459.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在外部面板中的项目之间添加边距_Javascript_Css_Layout_Extjs_Extjs4 - Fatal编程技术网

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'
}