PDA

View Full Version : Set button pressed



yo_haha
10 Oct 2012, 1:12 AM
Hi,

I have a button btn1 member of a toggle group. I want to set that button pressed when handling an event (and implicitly set the other button btn2 (that is currently pressed) of the toggle group unpressed). So I'm using
btn1.pressed = true;
btn2.pressed = false; to do it. The problem is that no one of the two buttons is set to the aimed pressed mode.

Do you have any hint?

Regards.

vietits
10 Oct 2012, 1:41 AM
You should use <button>.toggle() (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.button.Button-method-toggle) instead.


btn1.toggle(true);
btn2.toggle(false);

yo_haha
10 Oct 2012, 1:50 AM
Yes. Right answer. Thanks.