Creé un grupo de botones de alternar usando extjs4. Cuando presiono un botón, los otros botones cambian a no presionado. Luego quiero cambiar la imagen de fondo del botón después de presionarlo. Entonces uso "pressedCls". El código:cómo usar presionado para cambiar la imagen de fondo del botón en extjs4?
Ext.define('Crm.view.CrmNavi', {
extend: 'Ext.toolbar.Toolbar',
height: 27,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
cls: 'navi_btn',
overCls: 'navi_btn_over',
pressedCls: 'navi_btn_pressed',
xtype: 'button',
height: 24,
flex: 4,
html: 'button one'
toggleGroup: 'crmNaviBtnGroup',
enableToggle: true,
pressed: true
},
{
cls: 'navi_btn',
overCls: 'navi_btn_over',
pressedCls: 'navi_btn_pressed',
xtype: 'button',
height: 24,
flex: 4,
margin: '0 0 0 0',
html: 'button two',
toggleGroup: 'crmNaviBtnGroup',
enableToggle: true
}
]
});
}
});
//-----------------------------------------------------------
.navi_btn{
font-family: MicroSoft YaHei;
font-weight: 5;
font-size: 15px;
text-align: center;
color: #006f61;
}
.navi_btn_over{
font-family: MicroSoft YaHei;
font-weight: 3;
font-size: 15px;
text-align: center;
color: #ffffff;
background-image: url("images/crmNaviBtnPressed_bg.png");
background-repeat: repeat-x;
}
.x-navi_btn_pressed{
font-family: MicroSoft YaHei;
font-weight: 3;
font-size: 15px;
text-align: center;
color: #ffffff;
background-image: url("images/crmNaviBtnPressed_bg.png");
background-repeat: repeat-x;
}
// ------------------------------------- -----------------------------
Funciona bien en google chrome. Pero en IE8, la configuración de la imagen de fondo no funciona (la configuración de la fuente funciona bien). Entonces, ¿hay alguna configuración que pueda resolver este problema?
Puedes publicar tu css para navi_btn_pressed? –
Mientras "navi_btn_pressed" no funcionaba, agregué una "x-" a "navi_btn_pressed" en el archivo css. Verá, publiqué el CSS para "sobre" y "presioné". – user1011934
¿Ya lo tienes trabajando? – pacman