PDA

View Full Version : ToggleGroup with buttons



toxkillfraex
13 Mar 2012, 1:11 AM
I'm kinda lost on the toggleGroup setting and the documentation doesn't get me any wiser

I have three buttons with the same toggleGroup bot only one of them toggles the rest works like average buttons.

this is how I define them


inBtn = Ext.create('Ext.button.Button', {
xtype: 'button',
id: 'in',
text: 'in',
toggleGroup: 'searchBtns'
});
outBtn = Ext.create('Ext.button.Button',{
xtype: 'button',
id: 'out',
text: 'out',
togglegroup: 'searchBtns'
});
searchBtn = Ext.create('Ext.button.Button',{
xtype: 'button',
id: 'search',
text: 'search',
togglegroup: 'searchBtns'
});

afterwards I simple add them to a panel



Ext.applyIf(me,
{
items: [inBtn, outBtn, searchBtn, searchForm, grid]
});

I don't think the other variables of this panel are of interest here

do I need to group them in a container or something? Or does it only work in toolbars? Either way I'm not getting much feedback >.<

chramer
13 Mar 2012, 4:37 AM
inBtn = Ext.create('Ext.button.Button', {
xtype: 'button',
id: 'in',
text: 'in',
toggleGroup: 'searchBtns'
});
outBtn = Ext.create('Ext.button.Button',{
xtype: 'button',
id: 'out',
text: 'out',
toggleGroup: 'searchBtns'
});
searchBtn = Ext.create('Ext.button.Button',{
xtype: 'button',
id: 'search',
text: 'search',
toggleGroup: 'searchBtns'
});

toxkillfraex
13 Mar 2012, 4:49 AM
*headdesk*

lol stupid me xDD