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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:23:59+00:00 2026-05-19T00:23:59+00:00

I am trying to wrap a HTMLElement to create a Ext.Element but this mysteriously

  • 0

I am trying to wrap a HTMLElement to create a Ext.Element but this mysteriously overrides the Ext.id function with some ID and makes ExtJs unusable after that point

I have tried to make this simple example illustrating the problem though I had to dig thru lot of code in original app to find this subtle bug e.g. try this code online http://jsfiddle.net/rdudW/1/ or use this

<html>
<head>
<script type="text/javascript" src="adapter/ext/ext-base.js"></script> 
<script type="text/javascript" src="ext-all.js"></script> 
<script>
Ext.onReady(function(){
    alert(Ext.id)
    var elem = Ext.Element(document.getElementsByTagName('table')[0])
    alert(Ext.id)
});
</script>
</head>
<body>
<table><table>
</body>
</html>

Before calling Ext.Element alert show function definition but after that a id ‘ext-gen2’

Note: I know i should be using new Ext.Element but that is not the question, question is why this happens with this simple probable mistake?

  • 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-19T00:24:00+00:00Added an answer on May 19, 2026 at 12:24 am

    I’ve skimmed over the source, and there are a few functons, that if called in wrong scope would override Ext.id. The omission of new is probably doing just that. One of these functions is called in context of Ext object instad of Element being created.

    See this:

    Ext.Element = function(element, forceNew){
        var id;
        /* some code here */
    
        id = dom.id;
    
        /* some code here */
    
        /**
         * The DOM element ID
         * @type String
         */
        this.id = id || Ext.id(dom);
    };
    

    If you call this with new then this refers to newly created object. If you call this directly, this refers to Ext

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

Sidebar

Related Questions

I'm trying to wrap my head around reflection, so I decided to add plugin
I've been trying to wrap my head around how threads work in Python, and
I'm trying to wrap my head around creating a toolbar (a tool band in
I'm trying to wrap my head around asp.net. I have a background as a
I'm trying to wrap my head around SharePoint. Why is it good? Why is
I'm trying to wrap my head around the roles of UIViews and UIViewControllers. If
I'm trying to wrap my head around the best way to use IoC within
I'm trying to wrap my head around functional programming in ruby and there doesn't
I am trying to wrap my head around doing validation in a MVC scenario.
I’ve been trying to wrap my head around how to expose my domain objects

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.