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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:07:52+00:00 2026-06-14T05:07:52+00:00

I have a view which contains a tab control with 2 tabs. I have

  • 0

I have a view which contains a tab control with 2 tabs. I have defined an alias for each tab, in this format:

alias: 'widget.contenttab'

I am trying to access ‘contenttab’ in the controller but it says it is not defined:

contenttab is not defined

I am trying to set the html content of the tab in a select handler in the controller:

Ext.define('BP.controller.Induction', {
extend: 'Ext.app.Controller',

views: [
    'induction.Binder',
    'induction.LeftPage',
    'induction.RightPage',
],

stores: [
    'Sections',
    'Categories',
    'Tasks'
],

models: [
    'Section',
    'Category',
    'Task'
],


init: function() {
    this.control({
        'grid[xtype=categorygrid]': {
            itemclick: this.onItemClick 
        }
    });
    console.log('Initialized Induction!');
},


onItemClick: function(e, d) {
    console.log(d.data.category_id);
    this.getCategoriesStore().load({params:{'id':d.data.category_id}}, {
        success: function(category) {
            console.log("Category: " + category.get('name'));
        },
        error: function(e) {
            console.log(e);
        }
    });
    contenttab.html = 'test'; // produces error

}
});

The ‘contenttab’ is within my RightPage view. The line which produces an error ultimately needs to reside within the success callback function – but this isn’t getting fired (I have created another question here for that issue Extjs store load success handler not getting fired

Any guidance appreciated, thanks.

  • 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-14T05:07:53+00:00Added an answer on June 14, 2026 at 5:07 am

    In your case you should use a ComponentQuery to receive your tab-instances. I guess you will know at least the name of your tab so you can do

    var single = Ext.ComponentQuery.query('contenttab[title=YourTabName]')[0];
    

    Or if you need all tabs of that type.

    var list = Ext.ComponentQuery.query('contenttab');
    

    The result will always be a array therefor I used the array selector at the first example. You can do this at any point to get a instance. But the more often you do this for the same instance the more I would recommend you to store the instance as local variable. Especially when you are on the way to it within a loop.

    The is also the ref property within a controller, which do some things automatically for you. Some example:

    refs: [
            {
                ref: 'firstTab',
                selector: 'contenttab[title=YourTabName]'
            }
        ]
    

    This will create a method named getFirstTab() (note the auto camel-case) which refers to your tab (based on the provided query). Note that there are more options like autocreate. I must say, I never used this, but it wraps some things up for you which may be nice at startup.

    To answer your last comment of the previous question: Yes this is the correct way to do it.

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

Sidebar

Related Questions

I have a UITabBarController which contains 4 tabs. On each tab there should be
I have an admin view which contains four foreign keys each with a few
I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have a UITabBarController in my MainWindow.xib. Each tab contains a UINavigationController which has
I have a UITabBarController that has 3 tabs. Each tab contains a UITableViewController. When
I have an application that uses Caliburn.Micro. My View contains a user control which
i have view controller which contains a button which show the image library ,if
I have a grid view which contains a button in a template field. I
In my project I have a grid view which contains images. Based on my
I have a View that contains a ParentModel, which contains 2 Models. I only

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.