Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.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
如何更改extjs中按钮的填充?_Extjs - Fatal编程技术网

如何更改extjs中按钮的填充?

如何更改extjs中按钮的填充?,extjs,Extjs,是否可以动态更改放置在FormPanel中的按钮的填充 谢谢, 您可以使用CSS更改填充 Ext.create('Ext.Button', { text: 'Click me', renderTo: Ext.getBody(), cls: 'my-btn' }); /* The button wrapper */ .my-btn.x-btn { padding: 5px; } /** or the button itself */ .my-btn.x-btn

是否可以动态更改放置在FormPanel中的按钮的填充

谢谢,
您可以使用CSS更改填充

Ext.create('Ext.Button', {
    text: 'Click me',
    renderTo: Ext.getBody(),
    cls: 'my-btn'
});

/* The button wrapper */
.my-btn.x-btn {
   padding: 5px;
}

 /** or the button itself */
.my-btn.x-btn button {...}
或者你可以用JS破解它

Ext.create('Ext.Button', {
    text: 'Click me',
    renderTo: Ext.getBody(),
    padding: 10,
    handler: function() {
        alert('You clicked the button!');
    }
});

出于好奇:自定义css类可以应用于任何组件吗?@Christoph-Yes。看见