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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:50:00+00:00 2026-06-15T05:50:00+00:00

I create some items in initComponent() Problem is, this.items somehow referes to the class

  • 0

I create some items in initComponent()
Problem is, this.items somehow referes to the class variable, not to the instance variable.

So when I make two instances, I end up with two buttons.

items: [],
initComponent: function() {
  this.items.push( { xtype: 'button', ... }) ;
  this.callParent( arguments );
}

Since I have to use push, every time new elements get pushed in.

Is there some instance equivalent to this.items where I can modify the definition before the button gets created or do I have to check for duplicates manually?

  • 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-06-15T05:50:02+00:00Added an answer on June 15, 2026 at 5:50 am

    You shouldn’t return this.callParent( arguments );

    Just this is enough:

    initComponent: function() {
        var me = this;
        me.items = { xtype: 'button', ... }; //Are you sure items is filled up here?
        me.callParent();
    }
    

    Also if you’re writing your own ‘component’ and you want to pass parameters in the Ext.create I always do the following:

    constructor: function (config) {
        var me = this;
        Ext.apply(me, config); 
        me.callParent();
    }
    

    This will overwrite your items declaration in your class with the one you hand in the Ext.create()

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

Sidebar

Related Questions

I found some items regarding this questions on SO, but they do not satisfy
I'm trying to create a dynamic CheckBoxFor where some items are disabled. This is
I'm trying to create some Menu Item with Image & Label, using barry's class
i create some project but when start App. How to Run this App one
i create some links on the fly ... $('input[name=iplus]').click(function() { $(ol).append(<a href='#' title='delposition' class='beschr-+($(#billsumary
I would like to create some menu items in a loop from a list.
My goal is to create some kind of swing component that can do two
I create an AlertDialog with an AlertDialog.Builder and set some items with setItems() .
I followed tutorial from cocos2d official site . I try to create some items
When I first create my database I insert some items into it but I

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.