Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  14] [ 5]  / answers: 1 / hits: 18898  / 13 Years ago, mon, march 21, 2011, 12:00:00

I have a panel using the card layout as follows:



var cardpanel = new Ext.Panel(
{
id: 'cardPanel',
//title: 'Card Layout',
region: 'center',
layout: 'card',
activeItem: 0,
autoDestroy: false,
bodyStyle: 'border-top:0px',
defaults: {
border: false
},
items: [mediaGrid, mappanel],
tbar: [
{
id: 'card-media',
text: 'Media',
icon: '/img/silk/images.png',
width: 50,
handler: function () {
//switch to media
}
},
{
id: 'card-map',
text: 'Map',
icon: '/img/silk/map.png',
width: 50,
handler: function () {
//switch to map
}
}
]
});


The commented parts are where i would like to implement the switch between the 2 panels in the card layout but im not sure how to do that. I've tried using setActiveItem but I was always either getting the setActiveItem is not a function or it it just didnt say anything. How do i get it to switch panels?


More From » asp.net

 Answers
150

You need to call



this.layout.setActiveItem();


in handler and add



scope: cardpanel


under the handler definition.


[#93154] Saturday, March 19, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dantel

Total Points: 7
Total Questions: 102
Total Answers: 97

Location: Saint Lucia
Member since Sat, Jun 6, 2020
4 Years ago
;