PDA

View Full Version : Button with only ICON



disller
29 Apr 2012, 9:22 PM
Hi guys,

I am just migrating from Ext 3.4 to Ext 4.1.

In Ext 3.4, if there is only ICON (without text) in the button, the ICON will show at the center.
But In Ext 4.1, the ICON show at left-top of the button.

anyone who know how to make it to center?

Thx

debabrata
29 Apr 2012, 10:55 PM
try this


Ext.create('Ext.Button', {
renderTo: Ext.getBody(),
html: '<img src="pic/chart-col.jpg">'
});

disller
1 May 2012, 8:25 PM
it does not work... :(

friend
2 May 2012, 3:41 AM
Create this CSS style:



.centerIcon {
text-align: center;
}


Then define your button like this:



xtype: 'button',
cls: 'centerIcon',
text: '',
iconCls: 'someIconStyle',
width: 70