use segmented buttons as tabs
Hello,
I'm trying to use the segmented buttons to shift views in my container.
I've tried out the setActiveItem function but i dont quite get it right.
Here is my code:
Code:
{ title: 'Historik',
group: 'Meny',
// layout: 'vbox', // this makes me see both option 1 and 2..
items: [{
xtype: 'toolbar',
docked: 'top',
ui: 'dark',
scrollable: false,
items: [{
xtype: 'spacer'
},{
xtype: 'segmentedbutton',
allowDepress: false,
items: [{
text: 'Option 1',
pressed: 'true',
},{
text: 'Option 2',
handler: function() {
console.log("pressed 2");
/*
* - change view something like a tabpanel.
*/
//this.parent.setActiveItem();
//Ext.ComponentManager.get("services_id").setActiveItem("option_2");
}
}]
},{
xtype: 'spacer'
}]
},{
id: 'option_1',
html: "hello this is the first tab"
},{
id: 'option_2',
html: "hello, this is the second one"
}]
Any help would be appreciated. Thanks.