PDA

View Full Version : Ext.Toolbar disabledClass not working



bkraut
18 Dec 2012, 4:28 PM
I would like to completely hide a tbar on a panel. I created tbar like this:


{
html: 'Some text',
tbar: new Ext.Toolbar({
disabledClass: 'x-hidden',
items: ['->', {
text: 'Edit',
handler: function() {
alert('Editing 1');
},
scope: this
}]
}),
border: false
}


When I disable a toolbar it does not use my custom disabledClass property, but it uses default value. How this thing works, or is this a bug?

mitchellsimoens
20 Dec 2012, 7:32 AM
This is because Ext.Toolbar overrides the onDisable method to only disable the child items, not itself. You can still accomplish this vai this override:


var origFn = Ext.Toolbar.prototype.onDisable;

Ext.Toolbar.prototype.onDisable = function() {
origFn.call(this);

Ext.Toolbar.superclass.onDisable.call(this);
}