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 7669293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:33:42+00:00 2026-05-31T15:33:42+00:00

If I have an application which contains panels created with Ext.create, and those panels

  • 0

If I have an application which contains panels created with Ext.create, and those panels have items which are created with both Ext.create and configuration objects, I get a panel whose interface is completely unclickable and doesn’t respond to any interaction.

I’ve create a sample JSFiddle which illustrates the issue. Click the “TEST” button to see an example of this failure.

  • 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-31T15:33:43+00:00Added an answer on May 31, 2026 at 3:33 pm

    You can’t do component creation at class definition time. That is, using Ext.create directly inside config object of Ext.define:

    Ext.define('App.views.Panel1', {
        id:'panel1',
        extend:'Ext.Panel',
        config:{
            title: 'test',
            layout:'card',
            items:[
                {
                    items:[
                        {
                            xtype: 'button',
                            text: 'TEST',
                            handler:function(){
                                Ext.getCmp('panel1').setActiveItem(Ext.getCmp('panel2'));
                            }
                        }
                    ]
                },
                // not good
                Ext.create('App.views.Panel2', {id:'panel2'})
            ]
        }
    });
    

    Even if this would work, it would result in all instances of Panel1 sharing one Panel2 instance.

    Instead you should do your component creation at initialization time:

    Ext.define('App.views.Panel1', {
        id:'panel1',
        extend:'Ext.Panel',
        config:{
            title: 'test',
            layout:'card',
            items:[
                {
                    items:[
                        {
                            xtype: 'button',
                            text: 'TEST',
                            handler:function(){
                                Ext.getCmp('panel1').setActiveItem(Ext.getCmp('panel2'));
                            }
                        }
                    ]
                }
            ]
        },
    
        initialize: function() {
            this.add(Ext.create('App.views.Panel2', {id:'panel2'}));
            this.callParent();
        }
    });
    

    The initialize method is a good place to do any kind of extra work you want to do every time you create an instance of your component class. callParent is there because we override initialize of a parent class which might have some of its own logic in there which we want to keep.

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

Sidebar

Related Questions

I have a web application which contains both secure (SSL) and non-secure pages. A
I have Create application which contains google map. If i install app with debug
I have created an iPad application which contains images. I am storing these images
I have a wxPython application which contains a matplotlib panel (courtesy of wxmpl, though
I have created a java application which has a JTabbedPane that contains three JPanels.
I have a desktop application which contains an App.config (program.exe.config at release) with clearly
I have my main application delegate which contains a method that returns an object.
A simple question. I have an ASP.NET web application which contains several assemblies and
In my console application have an abstract Factory class Listener which contains code for
I have an Oracle table which contains event log messages for an application. We

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.