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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:53:08+00:00 2026-06-18T07:53:08+00:00

In the application below, I am trying to add id ‘s to the generated

  • 0

In the application below, I am trying to add id‘s to the generated items dynamically. My code works fine but when I add the below two commented lines in it. It throws error

Uncaught Ext.AbstractManager.register(): Registering duplicate id “73” with this manager


When I tried to find out the source of error, I found that the code is working fine till the execution of 81 id’s (console.log(_idGen)). From this, it is clear that the error is related to out of range exception. (9*9 = 81) and also only in Fiddle, when I add HTML text to the child panels, I came to know that they are between 73 to 81??(instead of 1 to 81) which is confusing me, how?

FIDDLE

Ext.onReady(function(){
  var _idGen = 1;
  var childItems = [], items = [];

  for (var i = 0; i < 9; i++) {
    childItems.length = 0;
    for (var j = 0; j < 9; j++) {
       childItems.push({
           xtype: 'panel',
 /****************************/
           id: _idGen,
           html: _idGen + "",
 /****************************/
           width: 50,
           height: 50,
           style: {borderWidth: '1px'}
       });
       console.log(_idGen);
/*****************************/
       _idGen++;
/*****************************/
    }
    items.push({
        xtype: 'panel',
        layout: {
            type: 'table',
            columns: 3
        },

        items: childItems
    });
  }
  Ext.create('Ext.container.Container', {
     layout: {
        type: 'table',
        // The total column count must be specified here
        columns: 3
     },
     renderTo: Ext.getBody(),    
     style: {width: '455px',marginLeft: 'auto',marginRight: 'auto', marginTop: '30px'},
     items: items
  });

});
  • 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-18T07:53:10+00:00Added an answer on June 18, 2026 at 7:53 am

    Don’t create Id’s by your won if not strictly required!

    It will always be a source of errors so why bother yourself with that when the framework already take care.

    Use custom identifier properties or better, the one that is already supported by the framework itemId. This property need only to be unique within each component level. You can also use the getComponent('your-item-id') method to receive a component that is nested into the calling one.

    I’ve modified your example to use itemId's and provided you demo query at the bottom

    See JSFiddle

    var _idGen = 1,
          _outerIdGen = 1;
      var childItems = [], items = [];
    
      for (var i = 0; i < 9; i++) {
      // You will keep the same array with and just alter all instances each time. 
      // This is what causes all your problems and the duplicates!      
      // childItems.length = 0; 
      // But you need a new array each time
        childItems = [];
        for (var j = 0; j < 9; j++) {
           childItems.push({
               xtype: 'panel',
               itemId: 'inner-'+_idGen++,
               html: _idGen + "",
               width: 50,
               height: 50,
               style: {margin: '1px',borderColor: 'white',backgroundColor:'cornflowerblue'}
           });
        }
        items.push({
            xtype: 'panel',
            layout: {
                type: 'table',
                columns: 3
            },
            itemId: 'outer-'+_outerIdGen++,
            items: childItems
        });
      }
      Ext.create('Ext.container.Container', {
         layout: {
            type: 'table',
            // The total column count must be specified here
            columns: 3
         },
         renderTo: Ext.getBody(),    
         style: {width: '455px',marginLeft: 'auto',marginRight: 'auto', marginTop: '30px'},
         items: items
      });
      console.log(Ext.ComponentQuery.query('container > panel[itemId=outer-1] > panel[itemId=inner-73]')[0]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a java application with gcj but getting the error below.
I'm trying to set up a Backbone application. This code below gives to following
I am trying to add two jquery plugins files to my application. When a
I'm trying to add a PDF generator to my website. Everything works fine as
Update: The problem below occurs when I add: <script src=http://code.jquery.com/jquery-1.7.1.min.js></script> I'm trying to redirect
The Orchardcms Application works fine accept when trying to Install new modules using the
I have been trying to add adMob on my application, but I have naver
I am trying to integratae my Grails application with extJS. Below is the code
I am trying to write a test case for the depot application. Below is
I am loading a WebView in an Android application with the below code: mWebView.loadURL(https://wat.harminson.com/html/index.html);

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.