Curious_k.shree
Curious_k.shree

Reputation: 1020

Card layout - Active Item - sencha touch

I am having one view which is in card layout. Card is having 2 sub views.

Now I want to get the activeitem. In extjs I am using this code:

 activeItem = layout.getActiveItem().itemId;

but in sencha touch , for card layout , there is no such method named getActiveItem() for card layout. I have referred sencha touch docs and I found that.

Anybody knows the alternative for this?

Upvotes: 1

Views: 2120

Answers (1)

Malay Shah
Malay Shah

Reputation: 146

var panel = Ext.create('Ext.Panel', {
layout: 'card',
items: [
    {
        html: "First Item"
    },
    {
        html: "Second Item"
    },
    {
        html: "Third Item"
    },
    {
        html: "Fourth Item"
    }
]
});

panel.setActiveItem(1);

It also have getActiveItem() method to work with.

Refer http://docs.sencha.com/touch/2-1/#!/api/Ext.layout.Card

Upvotes: 2

Related Questions