PDA

View Full Version : [FIXED]Toggle Button pressedCls ignored when inside toolbar



welshcathy
19 Feb 2011, 10:32 AM
Include a button, toggleEnabled:true, in a toolbar.
When pressed the defined class in pressedCls is not applied.

this.tbar = {
xtype: 'toolbar',
items:[{
xtype:'button',
id:'myBtn',
enableToggle:true,
cls:'myBtnCls',
pressedCls:'myBtnPressedCls'
}]
}

The pressedCls is not set correctly due to a bug in Button.js

onRender()

At this point
me.cls = 'myBtnCls'
me.baseCls = 'x-btn'
me.ui = 'toolbar'
me.pressedCls = 'myBtnPressedCls'

...
me.cls = (me.cls || '') + ' ' + me.baseCls + '-' + me.ui;
=> me.cls = 'myBtnCls x-btn-toolbar'

then a bit later
...
me.pressedCls = me.baseCls + '-' + me.ui + '-pressed';
=> me.pressedCls = 'x-btn-toolbar-small-pressed'
and the custom pressedCls value is totally lost ....

frankbolviken
11 Apr 2012, 1:08 PM
How was this fixed?