PDA

View Full Version : Toolbar button image background issue... How?



desp
22 Apr 2013, 2:18 AM
Hello there,



Ext.each(dynamicToolbarButts, function(item) {
self.add({
xtype: 'button',
// scale: 'large', // huh? nevermind..
width: 52,
height: 52,
cls: 'my-amazing-btn',
style: {
// this is not woooorking, why?
backgroundImage: '/images/rly_rly_rly_existing_image_and_its_small.png'
}
});
});


I want to set image-only big buttons on toolbar, how can I accomplish this?

slemmon
23 Apr 2013, 8:56 PM
You'll set the icon using the icon config pointing to an image - or you can source the image from a CSS class and use iconCls.
Then just set your button height/width to accommodate.

If you use icon you'll need to override the CSS rule: ".x-btn-default-small-icon .x-btn-icon-el" to be 52px tall/wide.