PDA

View Full Version : Register for Ext.MenuButton



zquirm
26 May 2007, 5:07 PM
Can you add this bit of code to Ext.MenuButton.prototype.render?



if(this.register){
Ext.ButtonToggleMgr.register(this);
}


I'd like to be able to include a MenuButton in a toggle group, even if it doesn't do it by default (hence the config, register).

Thanks.

zquirm
26 May 2007, 5:14 PM
and this...



if(this.pressed){
this.el.addClass("x-btn-pressed");
}

jack.slocum
26 May 2007, 5:51 PM
You are welcome to add in any custom stuff you want with sequences and interceptors. If we added every tweak everyone needed we would quickly have a 1mb ext-all.js.


Ext.MenuButton.prototype.render =
Ext.MenuButton.prototype.render.createSequence(function(){
if(this.register){
Ext.ButtonToggleMgr.register(this);
}
if(this.pressed){
this.el.addClass("x-btn-pressed");
}
});

zquirm
26 May 2007, 5:55 PM
makes sense :)

I haven't used this before...but it's perfect.