I have created two buttons in a panel :
{
xtype: 'button',
width: 196,
height: 29,
hidden: false,
text: "button1",
glyph: 'ab123@FontAwesome',
handler: 'onClick1',
reference: 'button1Click',
cls: 'buttons1Cls'
}, {
xtype: 'button',
width: 196,
height: 29,
hidden: false,
text: "button2",
glyph: 'ab123@FontAwesome',
handler: 'onClick2',
reference: 'button2Ref',
cls: 'buttons2Cls'
}
Each binded like shown to a different handler displaying different views like so :
onClick1: function () {
Ext.create('Mine.view.BaseWindow1', {
title: "panel1",
items: {
xtype: 'view1'
}
}).show();
}
And
onClick2: function () {
Ext.create('Mine.view.BaseWindow2', {
title: "panel2",
items: {
xtype: 'view2'
}
}).show();
}
My questions are how to make the panel1 and panel2 display exclusively :
- if one panel is open and a user clicks on the second button the first panel closes first for the second to open (toggling panels)
- one panel opens once (even in the case of a double click on the same button)
What i want is not a card layout solution but rather a solution where i can open centered windows individually on button click.