PDA

View Full Version : [FIXED]Ext.core.Element.removeCls issue



Greendrake
17 Feb 2011, 1:39 PM
I noted that Ext.core.Element.removeCls is sometimes called with argument containing several space-separated classes to remove. For example, in AbstractComponent.js, line 1669. In my case it was a button bound to a form and trying to enable itself when the form had become valid (it should be noted that the case occurs only if the button was disabled at the beginning). The this.disabledCls variable was containing the following value:

x-item-disabled x-btn-default-small-disabled

As Ext.core.Element.removeCls accepts single CSS class or array of single CSS classes only, the classes were not removed and the button remained looking disabled though it actually had become enabled (responding to clicks).

At this moment I have solved the issue overriding the relevant piece of code with

this.el.removeCls(this.disabledCls.split(' '));

Would the Team consider Ext.core.Element.removeCls to accept multiple space-separated classes, for example by modifying the piece of the removeCls code where className is checked against being an array like this:


if (!Ext.isArray(className)){
if (spacesRe.test(className)) {
return this.removeCls(className.split(spacesRe));
}
className = [className];
}

evant
19 Feb 2011, 4:17 AM
This has been implemented.