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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:41:12+00:00 2026-05-18T20:41:12+00:00

This is a novice question. Hopefully this example can educate myself and others As

  • 0

This is a novice question. Hopefully this example can educate myself and others As well as fix my problem.

I have an EXTJS layout that is very similar to the EXTJS complex layout example. A TabPanel is the center piece of this layout. One of the tabs renders a GridPanel that displays some data. I want to click on an Edit icon in the table and open up a separate tab to do the editing.

Here are my issues:

  • 1. If mainTabPnl is defined in view_main.js and the handler in grid.js, how do I add a tab to mainTabPnl? This seems like a scope issue.

  • 2. In the following Firefox line, ‘t’ is undefined. Why?

    var t = Ext.getCmp(‘main-tab-panel’);

  • 3. If I try to id my tabs, my whole layout goes haywire. What’s happening here?
    (see ‘center2’ tab). I thought that if I could do an Ext.getCmp(‘center2’) I could render something in in from a separate handler.

    Thanks for any help on this….

    // file: view_main.js
    var mainTabPnl =  new Ext.TabPanel({
            region: 'center', 
            id: 'main-tab-pnl',
            deferredRender: false,
            activeTab: 0,     
            items: [{
                contentEl: 'center2',
                //id: 'center2',  /*!!! screen goes haywire!! why? !!!*/
                title: 'Main Panel',
                autoScroll: true
            }, {
                contentEl: 'center1',
                title: 'Close Me',
                closable: true,
                autoScroll: true
            }]
        })
    
     // file: grid.js
     var columns = [{
       // Column Headers
       //...
        },{
            header: 'Actions',
            id: 'actions',
            xtype: 'actioncolumn',
            width: 50,
            items: [{
                 icon   : '/site_media/icons/application_edit.png',  
                 tooltip: 'Edit Record',
                 handler: function(grid, rowIndex, colIndex) {
                     alert("Add-Tab "); // The alert works..
    
                     /* but mainTabPnl is not defined */ 
                     mainTabPnl.add({
                         title: 'New Tab',
                         iconCls: 'tabs',
                         html: 'Tab Body <br/><br/>',
                         closable:true
                     }).show();
                 }
             }];
        }];
    
    • 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-18T20:41:12+00:00Added an answer on May 18, 2026 at 8:41 pm

      Collect all your UI initialization code into a single call to Ext.onReady made from a single file. This will ensure that the ExtJS library is fully initialized before you begin building your widgets and that interacting widgets are instantiated in the proper order.

      Specific answers:

      1: There is no “scoping issue” between multiple JS files pulled into the same page through standard includes. Global symbols defined in each file populate the same window object.

      2: ‘main-tab-panel’ doesn’t exist yet at the time of that call. Putting all UI initialization into the same Ext.onReady call will prevent this from happening.

      3: You are creating a DOM node with an ID identical to that which you are already using for contentEl.

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

    Sidebar

    Related Questions

    This is a novice question. Hopefully this example can educate myself and others As
    Such a novice question, but I can't seem to resolve this. if I have
    I have a very novice question, so apologies if the answer to this is
    This is likely a novice question about LINQ, but assuming I have a set
    This may be a novice question, but I can't figure it out by inspecting
    This might be a novice question. :). Consider the following scenario. Suppose we have
    Forgive this novice question (novice in Javascript!). In a html page I have a
    Ok, so that title probably doesn't explain my question well. Hopefully this makes sense.
    This is a really novice question, but I don't write C unless (err, if)
    So I don't consider myself a novice at MySQL but this one has me

    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.