Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3680930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:38:05+00:00 2026-05-19T03:38:05+00:00

I’m programming a Sencha Touch app with a moderately complex composition of Ext.TabBar with

  • 0

I’m programming a Sencha Touch app with a moderately complex composition of Ext.TabBar with Ext.Panel ‘s inside it.

But my Ext.Panel using Ext.layout.CardLayout runs in to a mysterious problem when not having a fullscreen: true property set on it: it throws an TypeError: Object card has no method 'setActiveItem' when I try to call the panel‘s .setActiveItem() method which it didn’t in my proof of concept version that had fullscreen: true turned on.

I can replicate the problem on Chrome’s console at a page with the Sencha Touch library loaded like this:

> var p1 = new Ext.Panel({layout:'card', items:[{html:'a'},{html:'b'}]})
undefined
> p1.setActiveItem(0)
TypeError: Object card has no method 'setActiveItem'

And it doesn’t happen with the .fullscreenproperty:

> var p2 = new Ext.Panel({fullscreen: true,
                          layout:'card',
                          items:[{html:'a'},{html:'b'}]})
undefined
> p2.setActiveItem(0)
subclass

What gives?

Version info: I’m using Sencha Touch 1.0.1a

Update 1 (Jan 3, ~10.30UTC+1h), stepping around with the debugger and discovering things:

Just setting layout: 'card' won’t trigger the creation of an actual Ext.layout.CardLayout object being created for real. Since .setActiveItem() tries to delegate to the compent’s .layout property, it will fail almost instantly. However, setting .layout to a new Ext.layout.CardLayout causes more problems down the line..

Update 2: (Jan 3, ~12:25UTC+1h) It all comes down to various component objects not being rendered/inserted in the dependency sufficiently to be ready to render. I managed to get my code working by adding listeners, first a listener for the added event in the enclosing panel that does a this.setLayout(new Ext.layout.CardLayout());, then an afterrender listener on the component being added that finally calls .setActiveItem() to switch to the desired card.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:38:05+00:00Added an answer on May 19, 2026 at 3:38 am

    A card layout works fine when it’s not the outer, fullscreen one, but of course something has to be the root, fullscreen panel.

    In this case, I’m using a ‘fit’ layout around the inner card layout, and setting the active item works fine:

    var inner = new Ext.Panel({
        layout:'card',
        items:[
            {html:'a'},
            {html:'b'}
        ]
    });
    
    var outer = new Ext.Panel({
        fullscreen:true,
        layout:'fit',
        items:[
            inner
        ]
    });
    

    I suspect the matter is more about whether the panel has been rendered or not, and fullscreen:true just happens to force immediate rendering (and of any children, which is why it works in my code above).

    This is from the Ext.Component source:

    if (this.fullscreen || this.floating) {
        this.monitorOrientation = true;
        this.autoRender = true;
    }
    
    if (this.fullscreen) {
        var viewportSize = Ext.Viewport.getSize();
        this.width = viewportSize.width;
        this.height = viewportSize.height;
        this.cls = (this.cls || '') + ' x-fullscreen';
        this.renderTo = document.body;
    }
    

    I suppose you could do some of this set up manually… but I have to ask, how do you avoid have a fullscreen ancestor component outside it in the first place?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.