2

FormPanel 内に配置されたボタンのパディングを動的に変更することは可能ですか?

ありがとう、Y_Y

4

1 に答える 1

3

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!');
    }
});
于 2012-10-12T18:24:23.250 に答える