PDA

View Full Version : Toggle Buttons Not Staying Toggled When Grouped



Peter Tierney
25 Jan 2013, 3:23 PM
If you create a set of buttons that act as toggles grouped together I'm seeing an interesting issue. If you click one of the buttons, it toggles as expected. If you then click the same already toggled button, it is set to the up state. While that makes sense for a single toggle button, it doesn't make sense in a group toggle situation as the toggled/down state indicates which of the group members is selected. Is there a way around this problem or some special property that needs to be set?

You can see an example of the behavior here
http://try.sencha.com/extjs/4.0.7/demos/Ext.Button.toggleGroup.1/

Cheers

skirtle
25 Jan 2013, 4:21 PM
I think you want allowDepress:

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.button.Button-cfg-allowDepress

slemmon
25 Jan 2013, 4:22 PM
On the buttons in the group set allowDepress (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.button.Button-cfg-allowDepress) to false.


... I was too slow in posting - Skirtle got the draw on me

Peter Tierney
25 Jan 2013, 5:06 PM
That setting is defaulted to true and I haven't expressly set it to false. I wish that had worked, simple answers are great.

slemmon
25 Jan 2013, 5:18 PM
Setting allowDepress: false on the buttons did work ok for you? Or did not?

Peter Tierney
25 Jan 2013, 5:22 PM
Sorry, my bad, I misunderstood. That did work. Thanks.