Extjs Ext JS 6.0.0按钮边距属性不工作

Extjs Ext JS 6.0.0按钮边距属性不工作,extjs,extjs6,extjs6-classic,Extjs,Extjs6,Extjs6 Classic,我在面板中有一个按钮,我需要设置一个边距值,但是组件没有应用边距值,EXT只是忽略边距属性 代码如下: Ext.define('CadastroEnsaioWTD.view.typecalculated.TypeCalculatedItem', { extend: 'Maestro.panel.Panel', requires: [ 'Maestro.form.Button', 'Maestro.form.TextField',

我在面板中有一个按钮,我需要设置一个边距值,但是组件没有应用边距值,EXT只是忽略边距属性

代码如下:

    Ext.define('CadastroEnsaioWTD.view.typecalculated.TypeCalculatedItem', {
    extend: 'Maestro.panel.Panel',

    requires: [
        'Maestro.form.Button',
        'Maestro.form.TextField',
        'Maestro.form.ComboBox'
    ],

    alias: 'widget.typecalculateditemview',
    layout: {
        type: 'hbox',
        align: 'middle'
    },
    width: '100%',
    height: '100%',

    initComponent: function () {

        var me = this;

        var config = {
            defaults: {
                width: 200,
                node: me.node,
                margin: '5 5 5 5',
                labelSeparator: '',
                xtype: 'maestro.form.textfield'
            },
            items: [
                {
                    xtype: 'label',
                    html: '<b>' + me.alias + '</b>',
                    width: 100
                },          
                {
                    width: 300,
                    xtype: 'maestro.form.combobox',
                    name: 'ENS_TIPO_DETERMINADO_CARACT'
                },
                {
                    xtype: 'maestro.form.combobox',
                    name: 'ENS_ENR_REFRIGERACAO_WTD'
                },
                {
                    name: 'ENS_PERC_CARGA_WTD'
                },
                {
                    name: 'ENS_COS_PHI'
                },
                {
                    width: 170,
                    xtype: 'maestro.form.combobox',
                    name: 'ENS_TIPO_ENR_APL_WTD'
                },
                {
                    width: 170,
                    xtype: 'maestro.form.combobox',
                    name: 'ENS_TIPO_ENR_CC_WTD'
                },
                {
                    name: 'ENS_ENR_TAP_TENSAO_APL'
                },
                {
                    name: 'ENS_ENR_TAP_TENSAO_CC'
                },
                {
                    name: 'ENS_POT_REF_WTD'
                },
                {
                    name: 'ENS_PERC_TENSAO_WTD'
                },
                {
                    width: 100,
                    name: 'ENS_TIPO_DETERMINADO_VAL'
                },
                {
                    width: 100,
                    xtype: 'maestro.form.combobox',
                    name: 'ENS_TIPO_DETERMINADO_UNID'
                },
                {
                    xtype: 'button',
                    text: '-',
                    width: 30,
                    style: 'border-radius: 7px;',
                    handler: function (btn) {
                        me.getObjectContextSynchronizer().executeServerRequest('deleteContextNode', [me.node]);
                    }
                }
            ]
        };
        Ext.apply(this, config);

        this.callParent();

    }

});
Ext.define('CadastroEnsaioWTD.view.typecalculated.TypeCalculatedItem'{
扩展:“Maestro.panel.panel”,
要求:[
“Maestro.form.Button”,
“Maestro.form.TextField”,
“Maestro.form.ComboBox”
],
别名:“widget.TypeCalculateEditemView”,
布局:{
类型:“hbox”,
对齐:“中间”
},
宽度:“100%”,
高度:“100%”,
initComponent:函数(){
var me=这个;
变量配置={
默认值:{
宽度:200,
节点:me.node,
边距:'5',
标签分离器:'',
xtype:'maestro.form.textfield'
},
项目:[
{
xtype:'标签',
html:''+me.alias+'',
宽度:100
},          
{
宽度:300,
xtype:'maestro.form.combobox',
名称:“ENS_TIPO_DETERMINADO_CARACT”
},
{
xtype:'maestro.form.combobox',
名称:'ENS_ENR_REFRIGERACAO_WTD'
},
{
名称:“ENS_PERC_CARGA_WTD”
},
{
名称:“ENS_COS_PHI”
},
{
宽度:170,
xtype:'maestro.form.combobox',
名称:“ENS_TIPO_ENR_APL_WTD”
},
{
宽度:170,
xtype:'maestro.form.combobox',
名称:'ENS_TIPO_ENR_CC_WTD'
},
{
名称:“ENS_ENR_TAP_TENSAO_APL”
},
{
名称:“ENS_ENR_TAP_TENSAO_CC”
},
{
名称:'ENS_POT_REF_WTD'
},
{
名称:“ENS_PERC_TENSAO”
},
{
宽度:100,
名称:“ENS_TIPO_DETERMINADO_VAL”
},
{
宽度:100,
xtype:'maestro.form.combobox',
名称:“ENS_TIPO_DETERMINADO_UNID”
},
{
xtype:'按钮',
正文:'-',
宽度:30,
样式:“边框半径:7px;”,
处理程序:函数(btn){
me.getObjectContextSynchronizer().executeServerRequest('deleteContextNode',[me.node]);
}
}
]
};
Ext.apply(这个,配置);
这是callParent();
}
});
如果我在组件渲染后通过chrome控制台设置值,使用Ext.getCmp('xxxx')。setMargin('15 0 0 0')不起作用,但如果我使用Ext.getCmp('xxxx')。getEl()。setMargin('15 0 0 0')起作用


我做错什么了吗?

您应该使用
样式:'margin:5px;'
而不是使用
边距
属性

,这样做是正确的。我用按钮边距为您创建了工作小提琴-


试着玩一下,重复你的问题。

margin
在这里很好