PDA

View Full Version : Card Layout



Levano
4 Oct 2012, 10:44 PM
Is this possible a Card-Layout in another Card-Layout?

|----1---|---2------3--- // First Card-Layout
..................|
.................V
.............|----1---|---2------3--- // Second Card-Layout

Gut
// First Card-Layout
var main = this.up('#firstCardLayoutPanel');
main.getLayout().setActiveItem(firstCardLayout-step-2');

Error: Problem in the Second Card Layout
// Second Card-Layout
var main = this.up('#secondCardLayoutPanel');
main.getLayout().setActiveItem('secondCardLayout-step-2');
// Error
Ext.getCmp("secondCardLayoutPanel").setActiveItem('secondCardLayout-step-2');// 'undefined' is not a function

skirtle
5 Oct 2012, 3:15 AM
Yes it is possible.

You haven't really explained what the problem is but this is the most obvious mistake:


Ext.getCmp("secondCardLayoutPanel").setActiveItem('secondCardLayout-step-2');

You need to call setActiveItem on the layout, not the container.

By the way, using fixed ids like this is generally considered bad practice.