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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:40:37+00:00 2026-05-16T03:40:37+00:00

I have a page with a toolbar on it, that is added through apply

  • 0

I have a page with a toolbar on it, that is added through apply like so (abridged code, lots of irrelevant stuff in the original):

var obj = Ext.extend(Ext.Panel,{
    initComponent:function(){
        Ext.apply(this,{
            layout:'card',
            itemId:'contactDetails',
            border:false,
            activeItem:0,
            tbar: new Ext.Toolbar({
                items:[{text:'New'},{text:'Edit',id:'editButton'}]
            })
        });
        obj.superclass.initComponent.apply(this);

     }, load:function() {
         this.tbar.findById('editButton').toggle(false); //Javascript error here about findById not being a function.
     }
   });

The above may not be syntactically correct either. It is in my code (at least to the extent that no javascript errors aside from the big one are thrown.)

  • 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-16T03:40:38+00:00Added an answer on May 16, 2026 at 3:40 am

    First off, you don’t have to override initComponent just to provide default configs. This will work the same way and is simpler:

    var obj = Ext.extend(Ext.Panel,{
        layout:'card',
        itemId:'contactDetails',
        border:false,
        activeItem:0,
        tbar: new Ext.Toolbar({
            items:[{text:'New'},{text:'Edit',id:'editButton'}]
        })
    });
    

    (Scratch my previous answer, I misread your code.)

    This might also solve your problem — since you are overriding initComponent in your code, you must call the superclass initComponent within your method or else things will not work. When overriding initComponent your code you should be doing this:

    initComponent: function(){
        Ext.apply(this,{
            layout:'card',
            itemId:'contactDetails',
            border:false,
            activeItem:0,
            tbar: new Ext.Toolbar({
                items:[{text:'New'},{text:'Edit',id:'editButton'}]
            })
        });
        obj.superclass.initComponent.apply(this, arguments);
    }
    

    Also, are you actually overriding the existing Panel.load() method for some reason? Or are you trying to add some different functionality and chose an existing method name by mistake?

    EDIT: Should have noticed this earlier, but the tbar config is not available after render as a valid property. From the docs for tbar: “To access the top toolbar after render, use getTopToolbar“

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

Sidebar

Related Questions

I have a page with an iframe. Inside the iframe is code (that I
I have text widgets that can be added on the page. A click should
I have a floating/static toolbar that I would like to delay until the visitor
I have a page that have toolbar at top and an iframe below the
So I have a toolbar that is on the left side of my page
I have a website that does not have page refreshes when the visitor navigates
I have a 'toolbar' div that I made resizable via jQuery UI. The weird
I have seen Ext.net's examples site in which each new page is added as
I have a toolbar that manipulates a Google map. Some of the functions affect
I have the main page that contains multiple frames within the frameset. One of

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.