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

  • Home
  • SEARCH
  • 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 6238805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:16:50+00:00 2026-05-24T11:16:50+00:00

This crashes: var grdMakes = Ext.extend(Ext.grid.Panel, { constructor: function(paConfig) { } } This does

  • 0

This crashes:

var grdMakes = Ext.extend(Ext.grid.Panel, {
  constructor: function(paConfig) {
  }
}

This does not:

var grdMakes = Ext.extend(Ext.grid.Panel, {
}

The crash is:

Uncaught TypeError: Cannot read property 'added' of undefined

Why does adding a constructor cause it to crash? I can do it with other objects like:

var pnlMakesMaint = Ext.extend(Ext.Panel, {
    constructor: function(paConfig) {
    }
}  // just fine

EDIT

To clarify what I want to do is that I want to be able to instantiate an object with the option to override the defaults.

var g = new grdMakes({});  // defaults used

var g = new grdMakes({renderTo: Ext.getBody()}); // renderTo overridden

This is working for everything except the Ext.grid.Panel

Also, I’m using ExtJS 4

SOLUTION

Turns out, extend is deprecated in ExtJS 4. So I used this and it works:

Ext.define('grdMakes', {
     extend: 'Ext.grid.Panel',

     constructor: function(paConfig) {
        var paConfig = Ext.apply(paConfig || {}, {
           columns:   !paConfig.columns ? [{
              header: 'Makes',
              dataIndex: 'make'
           }, {
              header: 'Description',
              dataIndex: 'description'
           }]: paConfig.columns,
           height:     !paConfig.height ? 400 : paConfig.height,
           renderTo:   !paConfig.renderTo ? Ext.getBody() : paConfig.renderTo,
           store:      !paConfig.store ? stoMakes : paConfig.store,
           title:      !paConfig.title ? 'Makes' : paConfig.title,
           width:      !paConfig.width ? 600 : paConfig.width

        });

        grdMakes.superclass.constructor.call(this, paConfig);
     }
}
  • 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-24T11:16:51+00:00Added an answer on May 24, 2026 at 11:16 am

    Ok.But your code seems like ExtJS3.Because Ext.extend is depreceated in ExtJS4 version.Instead of extend you can use define.For reference you can check the following url:

    http://docs.sencha.com/ext-js/4-0/#/api/Ext-method-extend

    Afaik,for overriding default options,this is not the perfect way.You need to use Ext.override.

    For example:

    Ext.override(Ext.grid.Panel,{
       lockable : true
    });
    

    Like above you have to override the default options.

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

Sidebar

Related Questions

My webpage crashes when I run this: function replace() { var str = document.getElementById('feeds');
std::string x(x); This crashes very badly on my compiler. Does this mean I should
When I put this in my header: <script> function checkiffinished() { var n =
I've been struggling with this for a while now, and this code crashes with,
I have a DLL with some COM objects . Sometimes, this objects crashes and
my app crashes often in this for-loop: for (int a = 0; a <=
This question comes from my experience with the following question: https://stackoverflow.com/questions/492748/new-responses-icon-on-so-crashes-ie7-closed In that question,
I'm trying to get this simple program to work on windows, but it crashes:
Why does this code get an access error on the Result := Buffer line
This is NOT a homework question, actually I am doing this for fun. Here

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.